From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: libvir-list@redhat.com, Anthony Liguori <aliguori@us.ibm.com>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [libvirt] virDomainBlockJobAbort and block_job_cancel
Date: Wed, 23 Nov 2011 09:04:50 -0700 [thread overview]
Message-ID: <4ECD19A2.4010501@redhat.com> (raw)
In-Reply-To: <CAJSP0QW5dFFz2tbX360+8sDvHkW3YiK1QogWTXPUG1=X=7=c6Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]
On 11/23/2011 07:48 AM, Stefan Hajnoczi wrote:
> This means that virDomainBlockJobAbort() returns to the client without
> a guarantee that the job has completed. If the client enumerates jobs
> it may still see a job that has not finished cancelling. The client
> must register a handler for the BLOCK_JOB_CANCELLED event if it wants
> to know when the job really goes away. The BLOCK_JOB_CANCELLED event
> has the same fields as the BLOCK_JOB_COMPLETED event, except it lacks
> the optional "error" message field.
>
> The impact on clients is that they need to add a BLOCK_JOB_CANCELLED
> handler if they really want to wait. Most clients today (not many
> exist) will be fine without waiting for cancellation.
>
> Any objections or thoughts on this?
virDomainBlockJobAbort() thankfully has an 'unsigned int flags'
argument. For backwards-compatibility, I suggest we use it:
calling virDomainBlockJobAbort(,0) maintains old blocking behavior, and
we document that blocking until things abort may render the rest of
interactions with the domain unresponsive.
The new virDomainBlockJobAbort(,VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC) would
then implement your new proposed semantics of returning immediately once
the cancellation has been requested, even if it hasn't been acted on yet.
Maybe you could convince me to swap the flags: have 0 change semantics
to non-blocking, and a new flag to request blocking, where callers that
care have to try the flag, and if the flag is unsupported then they know
they are talking to older libvirtd where the behavior is blocking by
default, but that's a bit riskier.
--
Eric Blake eblake@redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]
next prev parent reply other threads:[~2011-11-23 16:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-23 14:48 [Qemu-devel] virDomainBlockJobAbort and block_job_cancel Stefan Hajnoczi
2011-11-23 16:04 ` Eric Blake [this message]
2011-11-24 5:31 ` [Qemu-devel] [libvirt] " Daniel Veillard
2011-11-24 9:21 ` Stefan Hajnoczi
2011-12-07 22:35 ` Adam Litke
2011-12-07 23:01 ` Eric Blake
2011-12-08 14:55 ` Stefan Hajnoczi
2011-12-08 14:55 ` Adam Litke
2011-12-08 15:33 ` Stefan Hajnoczi
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=4ECD19A2.4010501@redhat.com \
--to=eblake@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=libvir-list@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).