From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4cvP-0005kM-9t for qemu-devel@nongnu.org; Mon, 05 Mar 2012 13:46:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4cvI-0001oG-Kj for qemu-devel@nongnu.org; Mon, 05 Mar 2012 13:46:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4cvI-0001ny-Cj for qemu-devel@nongnu.org; Mon, 05 Mar 2012 13:46:16 -0500 Message-ID: <4F5509CD.6050000@redhat.com> Date: Mon, 05 Mar 2012 11:45:33 -0700 From: Eric Blake MIME-Version: 1.0 References: <1330968842-24635-1-git-send-email-pbonzini@redhat.com> <1330968842-24635-5-git-send-email-pbonzini@redhat.com> In-Reply-To: <1330968842-24635-5-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig972AED7D13AEB2304827E291" Subject: Re: [Qemu-devel] [PATCH v3 4/8] add mode field to blockdev-snapshot-sync transaction item List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, fsimonce@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig972AED7D13AEB2304827E291 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/05/2012 10:33 AM, Paolo Bonzini wrote: > The mode field lets a management application create the snapshot > destination outside QEMU. >=20 > Right now, the only modes are "existing" and "absolute-paths". Mirrori= ng > introduces "no-backing-file". In the future "relative-paths" could be > implemented too. >=20 > Signed-off-by: Paolo Bonzini > --- > blockdev.c | 25 ++++++++++++++++--------- > qapi-schema.json | 21 ++++++++++++++++++++- > qmp-commands.hx | 10 ++++++++++ > 3 files changed, 46 insertions(+), 10 deletions(-) >=20 > =20 > ## > +# @NewImageMode > +# > +# An enumeration that tells QEMU how to set the backing file path in > +# a new image file. > +# > +# @existing: QEMU should look for an existing image file. > +# > +# @absolute-paths: QEMU should create a new image with absolute paths > +# for the backing file. > +# > +# @no-backing-file: QEMU should create a new image with no backing fil= e. Not present in this patch. Does it need to be rebased into the correct part of the series? > +# > +# Since: 1.1 > +## > +{ 'enum': 'NewImageMode' > + 'data': [ 'existing', 'absolute-paths' ] } > + > +## > # @BlockdevSnapshot > # > # @device: the name of the device to generate the snapshot from. > @@ -1127,7 +1145,8 @@ > # @format: #optional the format of the snapshot image, default is 'qco= w2'. > ## > { 'type': 'BlockdevSnapshot', > - 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str' = } } > + 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',= > + '*mode': 'NewImageMode' } } > =20 > ## > # @BlockdevAction > diff --git a/qmp-commands.hx b/qmp-commands.hx > index fb4f1df..7c03b62 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -705,6 +705,13 @@ A list of dictionaries is accepted, that contains = the actions to be performed. > For snapshots this is the device, the file to use for the new snapshot= , > and the format. The default format, if not specified, is qcow2. > =20 > +Each new snapshot defaults to being created by QEMU (wiping any > +contents if the file already exists), so this is mode of 'absolute-paths', which is the default if mode is not present, > but it is also possible to reuse > +an externally-created file. In the latter case, you should ensure tha= t > +the new image file has the same contents as the current one; QEMU cann= ot > +perform any meaningful check. Typically this is achieved by using the= > +current image file as the backing file for the new image. and this is mode 'existing'. Correct? If so, let's actually call that out in the wording. > + > Arguments: > =20 > actions array: > @@ -715,6 +722,8 @@ actions 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) > + - "mode": whether and how QEMU should create the snapshot file > + (NewImageMode, optional, default "absolute-paths") Well, this solves one of my two comments about the above wording, by calling out the default. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig972AED7D13AEB2304827E291 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/ iQEcBAEBCAAGBQJPVQnNAAoJEKeha0olJ0Nq9T8IAIHDj8Xu8wkHgg08RDEBHiaH c6Itfkk60dG6V97MUp65CPtyT2tzloOx9164OCXgk9iB95/3J4Pgz5oW3IMQwgy2 n5dvIWuQIw32sWGJ5kYw1lAP6iTJ8a+QkdW/6UdeTGPYYbOgVDdkC27EkfvNx0x8 Isz1uJuIUVyDjpBffi+neXbdafVYdnp3CtuCu7E61+7gRJRymy3cdQlk9m6WSOYo 67RSnjnziiNj5TcuOxhIwWwqCz04tT05l3MtSQLofGtRrf7LWOvdX6g8Wr3HeLhA nqCLTD42FkBXCEBSoUOKR8e+wcvNkcGtVUE0X0w7DvHq9UeJklNvCk6nzEkUb5I= =l4jQ -----END PGP SIGNATURE----- --------------enig972AED7D13AEB2304827E291--