From: Luiz Capitulino <lcapitulino@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
Eric Blake <eblake@redhat.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 08/15] qmp: add block_job_cancel command
Date: Fri, 20 Jan 2012 10:08:54 -0200 [thread overview]
Message-ID: <20120120100854.1a43ddf0@doriath> (raw)
In-Reply-To: <4F192635.9010707@redhat.com>
On Fri, 20 Jan 2012 09:30:45 +0100
Kevin Wolf <kwolf@redhat.com> wrote:
> Am 20.01.2012 01:02, schrieb Eric Blake:
> > On 01/06/2012 07:01 AM, Stefan Hajnoczi wrote:
> >> Add block_job_cancel, which stops an active block streaming operation.
> >> When the operation has been cancelled the new BLOCK_JOB_CANCELLED event
> >> is emitted.
> >>
> >> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> >
> >> +++ b/hmp-commands.hx
> >> @@ -98,6 +98,20 @@ Set maximum speed for a background block operation.
> >> ETEXI
> >>
> >> {
> >> + .name = "block_job_cancel",
> >> + .args_type = "device:B",
> >> + .params = "device",
> >> + .help = "stop an active block streaming operation",
> >> + .mhandler.cmd = hmp_block_job_cancel,
> >> + },
> >> +
> >
> > Looking at this from libvirt's perspective, would it be possible to give
> > this a different name? Then libvirt would know that if
> > block_job_cancel_async exists, we have the official semantics; and if it
> > doesn't exist, then we can try block_job_cancel as a fallback to see if
> > we have the old blocking semantics.
> >
> > But by using the same name as the old unofficial blocking command, it's
> > difficult to tell if we should expect an event, or whether completion of
> > the command means completion of the cancel.
> >
> > On the other hand, I guess we can rely on completion of the command,
> > followed by reading block job status to see if the job is still in
> > flight, will tell us whether we need to worry about waiting for an event
> > - if the job is complete (whether or not this command was the blocking
> > variant), we are done; if the job is ongoing, we have the new semantics
> > and can expect an event; and that only leaves the race of calling the
> > command, then the job completes, then we query and see it done, then the
> > event comes, where we just have to be ready to ignore an unexpected event.
>
> You're quoting the HMP part, is that intentional? You shouldn't be using
> this at all.
>
> Anyway, are there even any qemu versions out there that implement an
> older interface?
>
> >> +##
> >> +# @block_job_cancel:
> >> +#
> >> +# Stop an active block streaming operation.
> >> +#
> >> +# This command returns immediately after marking the active block streaming
> >> +# operation for cancellation. It is an error to call this command if no
> >> +# operation is in progress.
> >> +#
> >> +# The operation will cancel as soon as possible and then emit the
> >> +# BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
> >> +# enumerated using query-block-jobs.
> >
> > Is there any policy on _ vs - in command names? It seems awkward to
> > have block_job_cancel but query-block-jobs.
>
> block_job_cancel is HMP, whereas query-block-jobs is a QMP command. QMP
> uses - consistently. Not sure if HMP is consistent, but it tends to use _.
This very series broke QMP's consistency because it was designed when we
were following HMP's inconsistencies...
next prev parent reply other threads:[~2012-01-20 12:09 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-06 14:01 [Qemu-devel] [PATCH v4 00/15] block: generic image streaming Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 01/15] coroutine: add co_sleep_ns() coroutine sleep function Stefan Hajnoczi
2012-01-12 10:13 ` Kevin Wolf
2012-01-12 10:58 ` Stefan Hajnoczi
2012-01-12 11:07 ` Paolo Bonzini
2012-01-12 13:11 ` Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 02/15] block: check bdrv_in_use() before blockdev operations Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 03/15] block: add BlockJob interface for long-running operations Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 04/15] block: add image streaming block job Stefan Hajnoczi
2012-01-11 17:18 ` Luiz Capitulino
2012-01-12 9:11 ` Stefan Hajnoczi
2012-01-12 10:59 ` Kevin Wolf
2012-01-12 11:39 ` Stefan Hajnoczi
2012-01-12 12:53 ` Kevin Wolf
2012-01-12 13:05 ` Stefan Hajnoczi
2012-01-12 13:17 ` Kevin Wolf
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 05/15] block: rate-limit streaming operations Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 06/15] qmp: add block_stream command Stefan Hajnoczi
2012-01-11 17:23 ` Luiz Capitulino
2012-01-12 9:25 ` Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 07/15] qmp: add block_job_set_speed command Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 08/15] qmp: add block_job_cancel command Stefan Hajnoczi
2012-01-20 0:02 ` Eric Blake
2012-01-20 8:30 ` Kevin Wolf
2012-01-20 12:08 ` Luiz Capitulino [this message]
2012-01-20 19:55 ` Eric Blake
2012-02-07 15:44 ` Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 09/15] qmp: add query-block-jobs Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 10/15] blockdev: make image streaming safe across hotplug Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 11/15] block: add bdrv_find_backing_image Stefan Hajnoczi
2012-01-12 12:17 ` Kevin Wolf
2012-01-12 13:01 ` Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 12/15] add QERR_BASE_ID_NOT_FOUND Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 13/15] block stream: add support for partial streaming Stefan Hajnoczi
2012-01-12 12:42 ` Kevin Wolf
2012-01-12 16:14 ` Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 14/15] add doc to describe live block operations Stefan Hajnoczi
2012-01-06 14:01 ` [Qemu-devel] [PATCH v4 15/15] test: add image streaming test cases Stefan Hajnoczi
2012-01-11 17:58 ` [Qemu-devel] [PATCH v4 00/15] block: generic image streaming Luiz Capitulino
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=20120120100854.1a43ddf0@doriath \
--to=lcapitulino@redhat.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mtosatti@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).