From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2oT2-0007PX-UP for qemu-devel@nongnu.org; Wed, 29 Feb 2012 13:41:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2oT0-00014h-LH for qemu-devel@nongnu.org; Wed, 29 Feb 2012 13:41:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2oT0-00014E-CP for qemu-devel@nongnu.org; Wed, 29 Feb 2012 13:41:34 -0500 Message-ID: <4F4E7146.2020406@redhat.com> Date: Wed, 29 Feb 2012 11:41:10 -0700 From: Eric Blake MIME-Version: 1.0 References: <1330522650-15357-1-git-send-email-pbonzini@redhat.com> <1330522650-15357-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1330522650-15357-4-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigC90D59ED0B3DCE394B1DAAE8" Subject: Re: [Qemu-devel] [PATCH 3/6] rename blockdev-group-snapshot-sync List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, fsimonce@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC90D59ED0B3DCE394B1DAAE8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/29/2012 06:37 AM, Paolo Bonzini wrote: > We will add other kinds of operation. Prepare for this by adjusting > the schema and renaming some types/variables. >=20 > Signed-off-by: Paolo Bonzini > --- > blockdev.c | 73 +++++++++++++++++++++++++++++-----------------= ------- > qapi-schema.json | 33 ++++++++++++++++-------- > qmp-commands.hx | 51 ++++++++++++++++++++----------------- > 3 files changed, 90 insertions(+), 67 deletions(-) >=20 > ## > -# @blockdev-group-snapshot-sync > +# @blockdev-transaction > # > -# Generates a synchronous snapshot of a group of one or more block dev= ices, > -# as atomically as possible. If the snapshot of any device in the gro= up > -# fails, then the entire group snapshot will be abandoned and the > -# appropriate error returned. > +# Atomically operate on a group of one or more block devices. If > +# any operation fails, then the entire set of actions will be > +# abandoned and the appropriate error returned. The only operation > +# supported is currently snapshot. > # > # List of: > -# @SnapshotDev: information needed for the device snapshot > +# @BlockdevAction: information needed for the device snapshot > Arguments: > =20 > -devlist array: > - - "device": device name to snapshot (json-string) > - - "snapshot-file": name of new image file (json-string) > - - "format": format of new image (json-string, optional) > +actions array: > + - "type": the operation to perform. The only supported > + value is "snapshot". (json-string) > + - "data": a dictionary. The contents depend on the value > + of "type". When "type" is "snapshot": > + - "device": device name to snapshot (json-string) > + - "snapshot-file": name of new image file (json-string) > + - "format": format of new image (json-string, optional) I like it. Of course, this means I still have a moving target for implementing the libvirt side of things, so I'd like consensus sooner rather than later. More importantly, as long as blockdev-group-snapshot-sync is not part of a release, renaming it is fine; but if we get to the qemu 1.1 release with Jeff's patches but not Paolo's rename, then libvirt has a harder job to cope with both names. > =20 > Example: > =20 > --> { "execute": "blockdev-group-snapshot-sync", "arguments": > - { "devlist": [{ "device": "ide-hd0", > - "snapshot-file": "/some/place/my= -image", > - "format": "qcow2" }, > - { "device": "ide-hd1", > - "snapshot-file": "/some/place/my= -image2", > - "format": "qcow2" }] } } > +-> { "execute": "blockdev-transaction", > + "arguments": { "actions": [ > + { 'type': 'snapshot, 'data' : { "device": "ide-hd0", > + "snapshot-file": "/some/place= /my-image", > + "format": "qcow2" } }, > + { 'type': 'snapshot, 'data' : { "device": "ide-hd1", > + "snapshot-file": "/some/place= /my-image2", > + "format": "qcow2", > + "op": "snapshot" } } ] } } Drop the "op":"snapshot". It's a leftover from before your conversion to a union type. Question - when reading/writing these examples, are 'type' and "type" interchangeable (like in XML)? --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigC90D59ED0B3DCE394B1DAAE8 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.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPTnFGAAoJEKeha0olJ0NqVWEH/2ROZkfYS+MjKow2s6KNW0YH /fav/OeZMMjcbF9sFCEcXFsQBIm1Uilph//F1jiGGl87j3N0/TiWB8XIw1VRKUgh PTq0jksnmm1kynsbLydF3DuHlQGkpESUGu+nuGZuAZp/gB4r45YCfK+Zk/W7JVhR Ow3Qc7AUF7ppy2utbYWKqvwxnFaG4TY2vafoRv+/6TIeFjHSyIZNgBaqkqFilNKy tqwyWOjXTb+jbJS080Ci001d0W9X1i59R2DtsDkBFWj9gwRRw75vcQfeQRqWk2W3 sL72Kz8k0aRjLrDBXizHqCBa4Z8G+q93s8ktgQ4p1XAMdB+WcHWg0o1KC7Ntc8Y= =PtiV -----END PGP SIGNATURE----- --------------enigC90D59ED0B3DCE394B1DAAE8--