mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-05 09:37:49 +00:00
add lsi controller hotplug
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
This commit is contained in:
parent
5e5dcb7362
commit
cfc817c710
@ -2295,6 +2295,14 @@ sub vm_deviceplug {
|
|||||||
return undef;
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2310,6 +2318,11 @@ sub vm_deviceunplug {
|
|||||||
qemu_devicedel($vmid, $deviceid);
|
qemu_devicedel($vmid, $deviceid);
|
||||||
return undef if !qemu_devicedelverify($vmid, $deviceid);
|
return undef if !qemu_devicedelverify($vmid, $deviceid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($deviceid =~ m/^(lsi)(\d+)$/) {
|
||||||
|
return undef if !qemu_devicedel($vmid, $deviceid);
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2389,6 +2402,20 @@ sub qemu_devicedelverify {
|
|||||||
return undef;
|
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 {
|
sub vm_start {
|
||||||
my ($storecfg, $vmid, $statefile, $skiplock) = @_;
|
my ($storecfg, $vmid, $statefile, $skiplock) = @_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user