From ef88eaaa58a1198525ce45b3bd62e6dc91fd0c55 Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Tue, 13 Apr 2021 10:24:14 +0200 Subject: [PATCH] avoid setting lun number for drives when pvscsi controller is used Reported in the community forum[0]. In QEMU's hw/scsi/vmw_pvscsi.c in the SCSIBusInfo struct, the max_lun property is set to 0. This means that in our stack, one cannot have multiple disks and use 'scsihw: pvscsi' currently, as kvm would fail with bad scsi device lun: 1 Instead of increasing the lun number, increase the scsi-id, as we already do for lsi.* (in hw/scsi/lsi53c895a.c the max_lun property is also 0). [0]: https://forum.proxmox.com/threads/kvm-bad-scsi-device-lun-1.84318/ Signed-off-by: Fabian Ebner Reviewed-by: Stefan Reiter Tested-by: Stefan Reiter --- PVE/QemuServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 68459665..f435cc12 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -1451,7 +1451,7 @@ sub print_drivedevice_full { } } - if (!$conf->{scsihw} || ($conf->{scsihw} =~ m/^lsi/)){ + if (!$conf->{scsihw} || $conf->{scsihw} =~ m/^lsi/ || $conf->{scsihw} eq 'pvscsi') { $device = "scsi-$devicetype,bus=$controller_prefix$controller.0,scsi-id=$unit"; } else { $device = "scsi-$devicetype,bus=$controller_prefix$controller.0,channel=0,scsi-id=0"