5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-25 06:03:52 +03:00

add lsi controller hotplug

Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
This commit is contained in:
Derumier Alexandre 2012-01-20 11:42:06 +01:00 committed by Dietmar Maurer
parent 5e5dcb7362
commit cfc817c710

View File

@ -2295,6 +2295,14 @@ sub vm_deviceplug {
return undef;
}
}
if ($deviceid =~ m/^(lsi)(\d+)$/) {
my $pciaddr = print_pci_addr($deviceid);
my $devicefull = "lsi,id=$deviceid$pciaddr";
qemu_deviceadd($vmid, $devicefull);
return undef if(!qemu_deviceaddverify($vmid, $deviceid));
}
return 1;
}
@ -2310,6 +2318,11 @@ sub vm_deviceunplug {
qemu_devicedel($vmid, $deviceid);
return undef if !qemu_devicedelverify($vmid, $deviceid);
}
if ($deviceid =~ m/^(lsi)(\d+)$/) {
return undef if !qemu_devicedel($vmid, $deviceid);
}
return 1;
}
@ -2389,6 +2402,20 @@ sub qemu_devicedelverify {
return undef;
}
sub qemu_findorcreatelsi {
my ($storecfg, $conf, $vmid, $device) = @_;
my $maxdev = 7;
my $controller = int($device->{index} / $maxdev);
my $lsiid="lsi$controller";
my $devices_list = vm_devices_list($vmid);
if(!defined($devices_list->{$lsiid})) {
return undef if !vm_deviceplug($storecfg, $conf, $vmid, $lsiid);
}
return 1;
}
sub vm_start {
my ($storecfg, $vmid, $statefile, $skiplock) = @_;