From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ro1wN-00077W-7w for qemu-devel@nongnu.org; Thu, 19 Jan 2012 19:02:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ro1wL-00082n-EL for qemu-devel@nongnu.org; Thu, 19 Jan 2012 19:02:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ro1wL-00082i-7N for qemu-devel@nongnu.org; Thu, 19 Jan 2012 19:02:45 -0500 Message-ID: <4F18AF21.7010705@redhat.com> Date: Thu, 19 Jan 2012 17:02:41 -0700 From: Eric Blake MIME-Version: 1.0 References: <1325858501-25741-1-git-send-email-stefanha@linux.vnet.ibm.com> <1325858501-25741-9-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1325858501-25741-9-git-send-email-stefanha@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig164556CF89073AC49C1013B9" Subject: Re: [Qemu-devel] [PATCH v4 08/15] qmp: add block_job_cancel command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Marcelo Tosatti , qemu-devel@nongnu.org, Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig164556CF89073AC49C1013B9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Stefan Hajnoczi > +++ b/hmp-commands.hx > @@ -98,6 +98,20 @@ Set maximum speed for a background block operation. > ETEXI > =20 > { > + .name =3D "block_job_cancel", > + .args_type =3D "device:B", > + .params =3D "device", > + .help =3D "stop an active block streaming operation", > + .mhandler.cmd =3D 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= =2E > +## > +# @block_job_cancel: > +# > +# Stop an active block streaming operation. > +# > +# This command returns immediately after marking the active block stre= aming > +# 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 vis= ible 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. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig164556CF89073AC49C1013B9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPGK8hAAoJEKeha0olJ0NqxBsH/359EGom2eSWVUUrXqP4vRJV gj3U1hT7q7yNRbtHTb+066S7xGp0egoj/4HoqIRpCHusDALQWKAdFJMDt4ZIccx5 1Z3OKPUrOn47x2FdpeQhfN2DCN/3Wtx4NEWQE6xsJvyxtrjO+wdhYPKzVnnMwxjN n7KEuZWXIDFAfKhCXt2PMqKf9x80NKUtfJsOG5TsCiUnk6t6W2Wy9Ps243fSQ3me z1cP1e2GsLN8b1nqXN5zEqm5DhqrnD7/qd8r6T8cP2n1CZ/gw3cfgIaNmXvdqg1s 2QJvTUmrLhybf1N0G8KBq4lzo7jD4fJWIGKNVP0cRz50PAUDBNhtadiCHdlxMCM= =jE1l -----END PGP SIGNATURE----- --------------enig164556CF89073AC49C1013B9--