From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, stefanha@linux.vnet.ibm.com
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 [thread overview]
Message-ID: <1333106233-12472-2-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1333106233-12472-1-git-send-email-pbonzini@redhat.com>
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>
---
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
next prev parent reply other threads:[~2012-03-30 11:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-30 11:17 [Qemu-devel] [PATCH 0/4] Job API improvements and bugfixes Paolo Bonzini
2012-03-30 11:17 ` Paolo Bonzini [this message]
2012-04-02 15:38 ` [Qemu-devel] [PATCH 1/4] block: cancel jobs when a device is ready to go away Kevin Wolf
2012-03-30 11:17 ` [Qemu-devel] [PATCH 2/4] block: fix streaming/closing race Paolo Bonzini
2012-03-30 13:32 ` Stefan Hajnoczi
2012-03-30 11:17 ` [Qemu-devel] [PATCH 3/4] block: set job->speed in block_set_speed Paolo Bonzini
2012-03-30 11:17 ` [Qemu-devel] [PATCH 4/4] block: document job API Paolo Bonzini
2012-03-30 13:42 ` [Qemu-devel] [PATCH 0/4] Job API improvements and bugfixes Stefan Hajnoczi
2012-04-02 15:41 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1333106233-12472-2-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).