mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-06 18:31:56 +00:00
block: cancel jobs when a device is ready to go away
We do not want jobs to keep a device busy for a possibly very long time, and management could become confused because they thought a device was not even there anymore. So, cancel long-running jobs as soon as their device is going to disappear. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
498e386c58
commit
12bde0eed6
@ -64,6 +64,9 @@ void blockdev_mark_auto_del(BlockDriverState *bs)
|
|||||||
{
|
{
|
||||||
DriveInfo *dinfo = drive_get_by_blockdev(bs);
|
DriveInfo *dinfo = drive_get_by_blockdev(bs);
|
||||||
|
|
||||||
|
if (bs->job) {
|
||||||
|
block_job_cancel(bs->job);
|
||||||
|
}
|
||||||
if (dinfo) {
|
if (dinfo) {
|
||||||
dinfo->auto_del = 1;
|
dinfo->auto_del = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user