[pve-devel] [PATCH] add scsi boot workaround

Derumier Alexandre aderumier at odiso.com
Thu Dec 15 10:44:18 CET 2011


detect if lsi rom file exist and add bootindex on it
if not, add bootindex on scsi device

Signed-off-by: Derumier Alexandre <aderumier at odiso.com>
---
 PVE/QemuServer.pm |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 10c7d8e..734b0d2 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -908,9 +908,14 @@ sub print_drivedevice_full {
     } else {
 	die "unsupported interface type";
     }
-
-    $device .= ",bootindex=$drive->{bootindex}" if $drive->{bootindex};
-
+    
+    if($drive->{interface} eq 'scsi') {
+	unless (-e '/usr/share/kvm/8xx_64.rom') {
+	 $device .= ",bootindex=$drive->{bootindex}" if $drive->{bootindex};
+	}
+    } else {
+        $device .= ",bootindex=$drive->{bootindex}" if $drive->{bootindex};
+    }
     return $device;
 }
 
@@ -2139,6 +2144,7 @@ sub config_to_command {
            my $controller = int($drive->{index} / $maxdev);
 	   $pciaddr = print_pci_addr("scsi$controller");
            push @$cmd, '-device', "lsi,id=scsi$controller$pciaddr" if !$scsicontroller->{$controller};
+           push @$cmd, '-option-rom', "8xx_64.rom,bootindex=$drive->{bootindex}" if ($drive->{bootindex} &&  (-e '/usr/share/kvm/8xx_64.rom') );
            $scsicontroller->{$controller}=1;
         }
 
-- 
1.7.2.5




More information about the pve-devel mailing list