[pve-devel] [PATCH qemu-server] fix bad scsihw default value check

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Feb 13 12:11:12 CET 2017


This was checking for scsihw being set in both branches
whereas lsi is also the default. Added the missing 'not'.

Fixes a bug where a VM with a disk with a scsi index >= 7
refused to start due to an invalid scsi id.

Reported-by: Friedrich Ramberger <f.ramberger at proxmox.com>
---
 PVE/QemuServer.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index a9707c8..db575ac 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6304,7 +6304,7 @@ sub scsihw_infos {
 
     my $maxdev = 0;
 
-    if ($conf->{scsihw} && ($conf->{scsihw} =~ m/^lsi/)) {
+    if (!$conf->{scsihw} && ($conf->{scsihw} =~ m/^lsi/)) {
         $maxdev = 7;
     } elsif ($conf->{scsihw} && ($conf->{scsihw} eq 'virtio-scsi-single')) {
         $maxdev = 1;
-- 
2.1.4





More information about the pve-devel mailing list