]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vmx: Support super wide SCSI bus
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 29 Jul 2021 14:09:58 +0000 (16:09 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 16 Aug 2021 12:22:38 +0000 (14:22 +0200)
Since its 6.7 release, vSphere allows up to 64 units on a SCSI
bus [1]. The release version translates to virtualHW_version 13
and thus if we are dealing with sufficiently new version we can
enable the feature.

1: https://configmax.vmware.com/guest?vmwareproduct=vSphere&release=vSphere%206.7&categories=1-0

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1738392
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_conf.h
src/vmx/vmx.c
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-11.xml

index 375299f206a2036928c1f41f5f7a3c3252ede5cf..748b1d5f3093bf4b0035f5230fcb2cd9e00817a7 100644 (file)
@@ -2727,6 +2727,7 @@ struct _virDomainVirtioOptions {
 };
 
 
+#define SCSI_SUPER_WIDE_BUS_MAX_CONT_UNIT 64
 #define SCSI_WIDE_BUS_MAX_CONT_UNIT 16
 #define SCSI_NARROW_BUS_MAX_CONT_UNIT 7
 
index 46006b47d1f57519f35866376c724b855f944e2a..d3540acd84a815b76c80322a00ad0bf2a9ba897a 100644 (file)
@@ -1476,6 +1476,8 @@ virVMXParseConfig(virVMXContext *ctx,
                          "4 or higher but found %lld"),
                        virtualHW_version);
         goto cleanup;
+    } else if (virtualHW_version >= 13) {
+        def->scsiBusMaxUnit = SCSI_SUPER_WIDE_BUS_MAX_CONT_UNIT;
     }
 
     /* vmx:uuid.bios -> def:uuid */
@@ -1729,7 +1731,7 @@ virVMXParseConfig(virVMXContext *ctx,
         if (! present)
             continue;
 
-        for (unit = 0; unit < 16; ++unit) {
+        for (unit = 0; unit < def->scsiBusMaxUnit; unit++) {
             g_autoptr(virDomainDiskDef) disk = NULL;
 
             if (unit == 7) {
@@ -2164,7 +2166,8 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOption *xmlopt, virConf *conf,
      *                    VIR_DOMAIN_DISK_DEVICE_LUN}
      *         busType = VIR_DOMAIN_DISK_BUS_SCSI
      * controllerOrBus = [0..3] -> controller
-     *            unit = [0..6,8..15]
+     *            unit = [0..6,8..15] for virtualHW_version < 13
+     *            unit = [0..6,8..64] for virtualHW_version >= 13
      *
      *          device = {VIR_DOMAIN_DISK_DEVICE_DISK,
      *                    VIR_DOMAIN_DISK_DEVICE_CDROM,
@@ -2230,10 +2233,10 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOption *xmlopt, virConf *conf,
                 goto cleanup;
             }
 
-            if (unit < 0 || unit > 15 || unit == 7) {
+            if (unit < 0 || unit > vmdef->scsiBusMaxUnit || unit == 7) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
-                               _("SCSI unit index %d out of [0..6,8..15] range"),
-                               unit);
+                               _("SCSI unit index %d out of [0..6,8..%u] range"),
+                               unit, vmdef->scsiBusMaxUnit);
                 goto cleanup;
             }
 
index cf414975b32ab026b8264d17ca7c53a6f2bd0653..8807a057d7ca3ec20b7070c11191aa4f50df6cb5 100644 (file)
       <target dev='sda' bus='scsi'/>
       <address type='drive' controller='0' bus='0' target='0' unit='0'/>
     </disk>
+    <disk type='file' device='disk'>
+      <source file='[datastore] directory/esx6.7-rhel7.7-x86_64_3.vmdk'/>
+      <target dev='sdp' bus='scsi'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='16'/>
+    </disk>
     <controller type='scsi' index='0' model='vmpvscsi'/>
     <interface type='bridge'>
       <mac address='00:50:56:ac:3e:a1' type='generated'/>