fix bootorder

This commit is contained in:
Dietmar Maurer 2011-12-08 11:41:58 +01:00
parent ac021d2e1d
commit 0888fdce30

View File

@ -2025,20 +2025,12 @@ sub config_to_command {
my $bootorder = $conf->{boot} || $confdesc->{boot}->{default}; my $bootorder = $conf->{boot} || $confdesc->{boot}->{default};
my $bootindex_hash = { my $bootindex_hash = {};
c => 100, my $i = 1;
a => 200, foreach my $o (split(//, $bootorder)) {
d => 300, $bootindex_hash->{$o} = $i*100;
}; $i++;
}
if ($bootorder) {
$bootindex_hash = {};
my $i = 1;
foreach my $o (split(//, $bootorder)) {
$bootindex_hash->{$o} = $i*100;
$i++;
}
}
push @$cmd, '-boot', "menu=on"; push @$cmd, '-boot', "menu=on";
@ -2184,8 +2176,7 @@ sub config_to_command {
# qemu > 0.15 always try to boot from network - we disable that by # qemu > 0.15 always try to boot from network - we disable that by
# not loading the pxe rom file # not loading the pxe rom file
my $extra = (!$conf->{boot} || ($conf->{boot} !~ m/n/)) ? my $extra = ($bootorder !~ m/n/) ? "romfile=," : '';
"romfile=," : '';
$pciaddr = print_pci_addr("${k}"); $pciaddr = print_pci_addr("${k}");
my $tmpstr = "$device,${extra}mac=$net->{macaddr},netdev=${k}$pciaddr"; my $tmpstr = "$device,${extra}mac=$net->{macaddr},netdev=${k}$pciaddr";
if (my $bootindex = $bootindex_hash->{n}) { if (my $bootindex = $bootindex_hash->{n}) {