]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vmx: Generate correct disk target device ID for superwide SCSI master
authorMartin Kletzander <mkletzan@redhat.com>
Mon, 20 Apr 2026 19:45:59 +0000 (21:45 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 21 Apr 2026 07:18:11 +0000 (09:18 +0200)
Commit 32f7db0989e4 added support for superwide SCSI, but did not change
the disk ID calculation which resulted in a possible duplicate.  Change
it to calculate based on the (already decided) maximum of SCSI units per
bus and add a (well, modify existing) test case.

Fixes: 32f7db0989e4
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/vmx/vmx.c
tests/vmx2xmldata/esx-in-the-wild-11.vmx
tests/vmx2xmldata/esx-in-the-wild-11.xml

index 57dfd57cfc860a8efaf11d6c3c1d3c7f0ebe1310..1da5a0fd8a3187036f02b47b90a1b2b1ec407339 100644 (file)
@@ -2244,7 +2244,7 @@ virVMXGenerateDiskTarget(virDomainDiskDef *def,
             return -1;
         }
 
             return -1;
         }
 
-        idx = controllerOrBus * 15 + (unit < 7 ? unit : unit - 1);
+        idx = controllerOrBus * (vmdef->scsiBusMaxUnit - 1) + (unit < 7 ? unit : unit - 1);
         prefix = "sd";
         break;
 
         prefix = "sd";
         break;
 
index ae1d146f9a44eb41404f7507b9b6e35d4ad2d2b8..e6b547d8ace5f0367b41b2a20614e66706a15c36 100644 (file)
@@ -89,3 +89,9 @@ sched.scsi0:16.shares = "normal"
 sched.scsi0:16.throughputCap = "off"
 scsi0:16.present = "TRUE"
 scsi0:16.redo = ""
 sched.scsi0:16.throughputCap = "off"
 scsi0:16.present = "TRUE"
 scsi0:16.redo = ""
+scsi1.virtualDev = "pvscsi"
+scsi1.present = "TRUE"
+scsi1:0.deviceType = "scsi-hardDisk"
+scsi1:0.fileName = "esx6.7-rhel7.7-x86_64_4.vmdk"
+sched.scsi1:0.shares = "normal"
+scsi1:0.present = "TRUE"
index 8807a057d7ca3ec20b7070c11191aa4f50df6cb5..73befdeca0c648511cbf0290941b1d2a03a10904 100644 (file)
       <target dev='sdp' bus='scsi'/>
       <address type='drive' controller='0' bus='0' target='0' unit='16'/>
     </disk>
       <target dev='sdp' bus='scsi'/>
       <address type='drive' controller='0' bus='0' target='0' unit='16'/>
     </disk>
+    <disk type='file' device='disk'>
+      <source file='[datastore] directory/esx6.7-rhel7.7-x86_64_4.vmdk'/>
+      <target dev='sdbl' bus='scsi'/>
+      <address type='drive' controller='1' bus='0' target='0' unit='0'/>
+    </disk>
     <controller type='scsi' index='0' model='vmpvscsi'/>
     <controller type='scsi' index='0' model='vmpvscsi'/>
+    <controller type='scsi' index='1' model='vmpvscsi'/>
     <interface type='bridge'>
       <mac address='00:50:56:ac:3e:a1' type='generated'/>
       <source bridge='VM Network'/>
     <interface type='bridge'>
       <mac address='00:50:56:ac:3e:a1' type='generated'/>
       <source bridge='VM Network'/>