we need to remove drive after device has correctly by remove.
With this patch:
Windows : if drive is locked/"mounted", the hot-unplug fail and disk is accessible (100% safe)
Linux: without hotplug module : the hot-unplug fail and disk is accessible (100% safe)
Linux : with hotplug module : the hot-unplug work, but no verification is done is the drive is mounted
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
die "can't unplug bootdisk" if $conf->{bootdisk} && $conf->{bootdisk} eq $deviceid;
if ($deviceid =~ m/^(virtio)(\d+)$/) {
- return undef if !qemu_drivedel($vmid, $deviceid);
qemu_devicedel($vmid, $deviceid);
return undef if !qemu_devicedelverify($vmid, $deviceid);
+ return undef if !qemu_drivedel($vmid, $deviceid);
}
if ($deviceid =~ m/^(lsi)(\d+)$/) {