mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-06 04:16:59 +00:00
don't try to hotplug/unplug is device exist/don't exist
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
This commit is contained in:
parent
502d18a2e7
commit
95d6343bfa
@ -2228,6 +2228,9 @@ sub vm_deviceplug {
|
||||
|
||||
return 1 if !check_running($vmid) || !$conf->{hotplug};
|
||||
|
||||
my $devices_list = vm_devices_list($vmid);
|
||||
return 1 if defined($devices_list->{$deviceid});
|
||||
|
||||
if ($deviceid =~ m/^(virtio)(\d+)$/) {
|
||||
return undef if !qemu_driveadd($storecfg, $vmid, $device);
|
||||
my $devicefull = print_drivedevice_full($storecfg, $vmid, $device);
|
||||
@ -2273,6 +2276,9 @@ sub vm_deviceunplug {
|
||||
|
||||
return 1 if !check_running ($vmid) || !$conf->{hotplug};
|
||||
|
||||
my $devices_list = vm_devices_list($vmid);
|
||||
return 1 if !defined($devices_list->{$deviceid});
|
||||
|
||||
die "can't unplug bootdisk" if $conf->{bootdisk} && $conf->{bootdisk} eq $deviceid;
|
||||
|
||||
if ($deviceid =~ m/^(virtio)(\d+)$/) {
|
||||
|
Loading…
Reference in New Issue
Block a user