From: Martin Kletzander Date: Mon, 20 Apr 2026 19:45:59 +0000 (+0200) Subject: vmx: Generate correct disk target device ID for superwide SCSI X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2c7549d52e4520156d33320c02e6f4d4f0c1afe;p=thirdparty%2Flibvirt.git vmx: Generate correct disk target device ID for superwide SCSI 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 Reviewed-by: Daniel P. Berrangé --- diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 57dfd57cfc..1da5a0fd8a 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2244,7 +2244,7 @@ virVMXGenerateDiskTarget(virDomainDiskDef *def, return -1; } - idx = controllerOrBus * 15 + (unit < 7 ? unit : unit - 1); + idx = controllerOrBus * (vmdef->scsiBusMaxUnit - 1) + (unit < 7 ? unit : unit - 1); prefix = "sd"; break; diff --git a/tests/vmx2xmldata/esx-in-the-wild-11.vmx b/tests/vmx2xmldata/esx-in-the-wild-11.vmx index ae1d146f9a..e6b547d8ac 100644 --- a/tests/vmx2xmldata/esx-in-the-wild-11.vmx +++ b/tests/vmx2xmldata/esx-in-the-wild-11.vmx @@ -89,3 +89,9 @@ sched.scsi0:16.shares = "normal" 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" diff --git a/tests/vmx2xmldata/esx-in-the-wild-11.xml b/tests/vmx2xmldata/esx-in-the-wild-11.xml index 8807a057d7..73befdeca0 100644 --- a/tests/vmx2xmldata/esx-in-the-wild-11.xml +++ b/tests/vmx2xmldata/esx-in-the-wild-11.xml @@ -25,7 +25,13 @@
+ + + +
+ +