From afb85c5889a7b1c0cc8db445ea35628a77ab87a6 Mon Sep 17 00:00:00 2001 From: Matthias Bolte Date: Thu, 24 Jun 2010 16:58:54 +0200 Subject: [PATCH] esx: Allow 'vmpvscsi' as SCSI controller model --- docs/drvesx.html.in | 13 +++++++++++- docs/schemas/domain.rng | 1 + src/conf/domain_conf.c | 3 ++- src/conf/domain_conf.h | 1 + src/esx/esx_vmx.c | 25 ++++++++++++++++------- tests/vmx2xmldata/vmx2xml-scsi-driver.vmx | 5 +++++ tests/vmx2xmldata/vmx2xml-scsi-driver.xml | 6 ++++++ tests/xml2vmxdata/xml2vmx-scsi-driver.vmx | 5 +++++ tests/xml2vmxdata/xml2vmx-scsi-driver.xml | 5 +++++ 9 files changed, 55 insertions(+), 9 deletions(-) diff --git a/docs/drvesx.html.in b/docs/drvesx.html.in index bc7e1a0201..88c70bc967 100644 --- a/docs/drvesx.html.in +++ b/docs/drvesx.html.in @@ -302,7 +302,13 @@ ethernet0.checkMACAddress = "false"
lsisas1068
- LSI Logic SAS 1068 controller. + LSI Logic SAS 1068 controller. Since 0.8.0 +
+
vmpvscsi
+
+ Special VMware Paravirtual SCSI controller, requires VMware tools inside + the guest. See VMware KB1010398 + for details. Since 0.8.3

@@ -642,5 +648,10 @@ Enter administrator password for example-vcenter.com: VMware VMX config parameters +

  • + + VMware ESX 4.0 PVSCSI Storage Performance + +
  • diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng index 08e7c01d93..9289c8f9e4 100644 --- a/docs/schemas/domain.rng +++ b/docs/schemas/domain.rng @@ -679,6 +679,7 @@ buslogic lsilogic lsisas1068 + vmpvscsi diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 680d5c95d6..b52656166c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -143,7 +143,8 @@ VIR_ENUM_IMPL(virDomainController, VIR_DOMAIN_CONTROLLER_TYPE_LAST, VIR_ENUM_IMPL(virDomainControllerModel, VIR_DOMAIN_CONTROLLER_MODEL_LAST, "buslogic", "lsilogic", - "lsisas1068") + "lsisas1068", + "vmpvscsi") VIR_ENUM_IMPL(virDomainFS, VIR_DOMAIN_FS_TYPE_LAST, "mount", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 7728b6e7be..2a60515a45 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -199,6 +199,7 @@ enum virDomainControllerModel { VIR_DOMAIN_CONTROLLER_MODEL_BUSLOGIC, VIR_DOMAIN_CONTROLLER_MODEL_LSILOGIC, VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068, + VIR_DOMAIN_CONTROLLER_MODEL_VMPVSCSI, VIR_DOMAIN_CONTROLLER_MODEL_LAST }; diff --git a/src/esx/esx_vmx.c b/src/esx/esx_vmx.c index e10e74584a..c69e116d29 100644 --- a/src/esx/esx_vmx.c +++ b/src/esx/esx_vmx.c @@ -428,6 +428,15 @@ def->parallels[0]... #define ESX_BUILD_VMX_NAME(_suffix) \ snprintf(_suffix##_name, sizeof(_suffix##_name), "%s."#_suffix, prefix); +/* directly map the virDomainControllerModel to esxVMX_SCSIControllerModel, + * this is good enough for now because all virDomainControllerModel values + * are actually SCSI controller models in the ESX case */ +VIR_ENUM_DECL(esxVMX_SCSIControllerModel) +VIR_ENUM_IMPL(esxVMX_SCSIControllerModel, VIR_DOMAIN_CONTROLLER_MODEL_LAST, + "buslogic", + "lsilogic", + "lsisas1068", + "pvscsi"); int @@ -740,11 +749,12 @@ esxVMX_GatherSCSIControllers(virDomainDefPtr def, int virtualDev[4], if (controller->model != -1 && controller->model != VIR_DOMAIN_CONTROLLER_MODEL_BUSLOGIC && controller->model != VIR_DOMAIN_CONTROLLER_MODEL_LSILOGIC && - controller->model != VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068) { + controller->model != VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068 && + controller->model != VIR_DOMAIN_CONTROLLER_MODEL_VMPVSCSI) { ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Expecting domain XML attribute 'model' of entry " "'controller' to be 'buslogic' or 'lsilogic' or " - "'lsisas1068' but found '%s'"), + "'lsisas1068' or 'vmpvscsi' but found '%s'"), virDomainControllerModelTypeToString(controller->model)); return -1; } @@ -1478,16 +1488,17 @@ esxVMX_ParseSCSIController(virConfPtr conf, int controller, bool *present, *tmp = c_tolower(*tmp); } - *virtualDev = virDomainControllerModelTypeFromString(virtualDev_string); + *virtualDev = esxVMX_SCSIControllerModelTypeFromString(virtualDev_string); if (*virtualDev == -1 || (*virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_BUSLOGIC && *virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_LSILOGIC && - *virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068)) { + *virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068 && + *virtualDev != VIR_DOMAIN_CONTROLLER_MODEL_VMPVSCSI)) { ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Expecting VMX entry '%s' to be 'buslogic' or 'lsilogic' " - "or 'lsisas1068' but found '%s'"), virtualDev_name, - virtualDev_string); + "or 'lsisas1068' or 'pvscsi' but found '%s'"), + virtualDev_name, virtualDev_string); goto failure; } } @@ -2619,7 +2630,7 @@ esxVMX_FormatConfig(esxVI_Context *ctx, virCapsPtr caps, virDomainDefPtr def, if (scsi_virtualDev[i] != -1) { virBufferVSprintf(&buffer, "scsi%d.virtualDev = \"%s\"\n", i, - virDomainControllerModelTypeToString + esxVMX_SCSIControllerModelTypeToString (scsi_virtualDev[i])); } } diff --git a/tests/vmx2xmldata/vmx2xml-scsi-driver.vmx b/tests/vmx2xmldata/vmx2xml-scsi-driver.vmx index cb055f6d7b..64d7c99d3a 100644 --- a/tests/vmx2xmldata/vmx2xml-scsi-driver.vmx +++ b/tests/vmx2xmldata/vmx2xml-scsi-driver.vmx @@ -6,6 +6,8 @@ scsi1.present = "true" scsi1.virtualDev = "lsilogic" scsi2.present = "true" scsi2.virtualDev = "lsisas1068" +scsi3.present = "true" +scsi3.virtualDev = "pvscsi" scsi0:0.present = "true" scsi0:0.deviceType = "scsi-hardDisk" scsi0:0.fileName = "harddisk1.vmdk" @@ -15,3 +17,6 @@ scsi1:0.fileName = "harddisk2.vmdk" scsi2:0.present = "true" scsi2:0.deviceType = "scsi-hardDisk" scsi2:0.fileName = "harddisk3.vmdk" +scsi3:0.present = "true" +scsi3:0.deviceType = "scsi-hardDisk" +scsi3:0.fileName = "harddisk4.vmdk" diff --git a/tests/vmx2xmldata/vmx2xml-scsi-driver.xml b/tests/vmx2xmldata/vmx2xml-scsi-driver.xml index d39415d162..553783b62e 100644 --- a/tests/vmx2xmldata/vmx2xml-scsi-driver.xml +++ b/tests/vmx2xmldata/vmx2xml-scsi-driver.xml @@ -26,8 +26,14 @@
    + + + +
    + + diff --git a/tests/xml2vmxdata/xml2vmx-scsi-driver.vmx b/tests/xml2vmxdata/xml2vmx-scsi-driver.vmx index 7cceca0cbf..a92d7fc98c 100644 --- a/tests/xml2vmxdata/xml2vmx-scsi-driver.vmx +++ b/tests/xml2vmxdata/xml2vmx-scsi-driver.vmx @@ -11,6 +11,8 @@ scsi1.present = "true" scsi1.virtualDev = "lsilogic" scsi2.present = "true" scsi2.virtualDev = "lsisas1068" +scsi3.present = "true" +scsi3.virtualDev = "pvscsi" scsi0:0.present = "true" scsi0:0.deviceType = "scsi-hardDisk" scsi0:0.fileName = "/vmfs/volumes/datastore/directory/harddisk1.vmdk" @@ -20,3 +22,6 @@ scsi1:0.fileName = "/vmfs/volumes/datastore/directory/harddisk2.vmdk" scsi2:0.present = "true" scsi2:0.deviceType = "scsi-hardDisk" scsi2:0.fileName = "/vmfs/volumes/datastore/directory/harddisk3.vmdk" +scsi3:0.present = "true" +scsi3:0.deviceType = "scsi-hardDisk" +scsi3:0.fileName = "/vmfs/volumes/datastore/directory/harddisk4.vmdk" diff --git a/tests/xml2vmxdata/xml2vmx-scsi-driver.xml b/tests/xml2vmxdata/xml2vmx-scsi-driver.xml index 797a26e4ae..ac630ee5ba 100644 --- a/tests/xml2vmxdata/xml2vmx-scsi-driver.xml +++ b/tests/xml2vmxdata/xml2vmx-scsi-driver.xml @@ -21,5 +21,10 @@ + + + + +