[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/4] block: cancel jobs when a device is ready to go
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 1/4] block: cancel jobs when a device is ready to go away |
Date: |
Fri, 30 Mar 2012 13:17:10 +0200 |
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 <address@hidden>
---
blockdev.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 1a500b8..855a42d 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -64,6 +64,9 @@ void blockdev_mark_auto_del(BlockDriverState *bs)
{
DriveInfo *dinfo = drive_get_by_blockdev(bs);
+ if (bs->job) {
+ block_job_cancel(bs->job);
+ }
if (dinfo) {
dinfo->auto_del = 1;
}
--
1.7.9.1