mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-02 21:14:59 +00:00
add scsi disk hotplug/unplug
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
This commit is contained in:
parent
cfc817c710
commit
a4f091a073
@ -2303,6 +2303,16 @@ sub vm_deviceplug {
|
||||
return undef if(!qemu_deviceaddverify($vmid, $deviceid));
|
||||
}
|
||||
|
||||
if ($deviceid =~ m/^(scsi)(\d+)$/) {
|
||||
return undef if !qemu_findorcreatelsi($storecfg,$conf, $vmid, $device);
|
||||
return undef if !qemu_driveadd($storecfg, $vmid, $device);
|
||||
my $devicefull = print_drivedevice_full($storecfg, $vmid, $device);
|
||||
if(!qemu_deviceadd($vmid, $devicefull)) {
|
||||
qemu_drivedel($vmid, $deviceid);
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2323,6 +2333,11 @@ sub vm_deviceunplug {
|
||||
return undef if !qemu_devicedel($vmid, $deviceid);
|
||||
}
|
||||
|
||||
if ($deviceid =~ m/^(scsi)(\d+)$/) {
|
||||
return undef if !qemu_devicedel($vmid, $deviceid);
|
||||
return undef if !qemu_drivedel($vmid, $deviceid);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user