From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeQaT-0004Vo-Ur for qemu-devel@nongnu.org; Tue, 22 Sep 2015 12:38:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeQaS-0007lR-Pe for qemu-devel@nongnu.org; Tue, 22 Sep 2015 12:38:37 -0400 References: <8cc989a360a5fe38839144946c878fb9f8c6a6d5.1442928283.git.berto@igalia.com> From: Max Reitz Message-ID: <56018403.5040209@redhat.com> Date: Tue, 22 Sep 2015 18:38:27 +0200 MIME-Version: 1.0 In-Reply-To: <8cc989a360a5fe38839144946c878fb9f8c6a6d5.1442928283.git.berto@igalia.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="r0cg7pfha9npPdweUvs2QIe8nF6lK8AtX" Subject: Re: [Qemu-devel] [PATCH v6 3/4] block: add a 'blockdev-snapshot' QMP command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --r0cg7pfha9npPdweUvs2QIe8nF6lK8AtX Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 22.09.2015 15:28, Alberto Garcia wrote: > One of the limitations of the 'blockdev-snapshot-sync' command is that > it does not allow passing BlockdevOptions to the newly created > snapshots, so they are always opened using the default values. >=20 > Extending the command to allow passing options is not a practical > solution because there is overlap between those options and some of > the existing parameters of the command. >=20 > This patch introduces a new 'blockdev-snapshot' command with a simpler > interface: it just takes two references to existing block devices that > will be used as the source and target for the snapshot. >=20 > Since the main difference between the two commands is that one of them > creates and opens the target image, while the other uses an already > opened one, the bulk of the implementation is shared. >=20 > Signed-off-by: Alberto Garcia > Cc: Eric Blake > Cc: Max Reitz > --- > blockdev.c | 163 ++++++++++++++++++++++++++++++++-----------= -------- > qapi-schema.json | 2 + > qapi/block-core.json | 28 +++++++++ > qmp-commands.hx | 38 ++++++++++++ > 4 files changed, 171 insertions(+), 60 deletions(-) >=20 [snip] > diff --git a/qmp-commands.hx b/qmp-commands.hx > index 495670b..e5bd0e0 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -1454,6 +1454,44 @@ Example: > EQMP > =20 > { > + .name =3D "blockdev-snapshot", > + .args_type =3D "node:s,overlay:s", > + .mhandler.cmd_new =3D qmp_marshal_input_blockdev_snapshot, As of 7fad30f06eb6aa57aaa8f3d264288f24ae7646f0, this needs to be qmp_marshal_blockdev_snapshot. > + }, > + > +SQMP > +blockdev-snapshot > +----------------- > +Since 2.5 > + > +Create a snapshot, by installing 'node' as the backing image of > +'overlay'. Additionally, if 'node' is associated with a block > +device, the block device changes to using 'overlay' as its new active > +image. > + > +Arguments: > + > +- "node": device that will have a snapshot created (json-string) > +- "overlay": device that will have 'node' as its backing image (json-s= tring) > + > +Example: > + > +-> { "execute": "blockdev-add", > + "arguments": { "options": { "driver": "qcow2", > + "node-name": "node1534", > + "file": { "driver": "file"= , > + "filename": "hd1= =2Eqcow2" }, > + "backing": "" } } } > + > +<- { "return": {} } > + > +-> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",= > + "overlay": "node15= 34" } } > +<- { "return": {} } > + > +EQMP > + > + { > .name =3D "blockdev-snapshot-internal-sync", > .args_type =3D "device:B,name:s", > .mhandler.cmd_new =3D qmp_marshal_input_blockdev_snapshot_inte= rnal_sync, Consequently, this context needs to be fixed up, too. With that changed: Reviewed-by: Max Reitz --r0cg7pfha9npPdweUvs2QIe8nF6lK8AtX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWAYQDAAoJEDuxQgLoOKytBmMIAIxQy0sQRS4OafS/Z1MZlFGq cZcPCSXK119wnhXA5zL8SIh66AmViDQmKlj+RYQYjHDfBUne8HKIY9FDraA6Egdi j6786C2gUzlaeS+QJtnzZkSnKdo5F5DR6zWHsxVU7ihi553JE21TdqoLDkZeSXh/ kQgLeIfzoK98XMS2/2AuOe292A0BD42mrLUVx95clRrPidixx9MrOuio9VR+Zg8y Lw84P8QoHB/DIR84doCAXn5HF0hP9MDUmWPIv9BeZ1Dpe9n+zVrawtR35Afcu/5b ng/U5y/ggRBYwt8Z6L7PI4734IG9HxU4p/adVxGhZnR3wU1u9QFJ60rH1Wzo/Ws= =wlYK -----END PGP SIGNATURE----- --r0cg7pfha9npPdweUvs2QIe8nF6lK8AtX--