From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzXR5-00080c-ES for qemu-devel@nongnu.org; Mon, 20 Feb 2012 12:54:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzXR0-00046P-Rp for qemu-devel@nongnu.org; Mon, 20 Feb 2012 12:54:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzXFD-0002MJ-3j for qemu-devel@nongnu.org; Mon, 20 Feb 2012 12:41:47 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1KHfjxX011412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 20 Feb 2012 12:41:45 -0500 Message-ID: <4F4285D8.3030509@redhat.com> Date: Mon, 20 Feb 2012 10:41:44 -0700 From: Eric Blake MIME-Version: 1.0 References: <82683103d1b30237a58f760ee068f98e0a9b4dd1.1329758006.git.jcody@redhat.com> In-Reply-To: <82683103d1b30237a58f760ee068f98e0a9b4dd1.1329758006.git.jcody@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig63F09EA95B74C482BAD6C897" Subject: Re: [Qemu-devel] [PATCH 2/3] qapi: Introduce blockdev-group-snapshot-sync command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: Kevin Wolf , Luiz Capitulino , qemu-devel@nongnu.org, Markus Armbruster This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig63F09EA95B74C482BAD6C897 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/20/2012 10:31 AM, Jeff Cody wrote: > This is a QAPI/QMP only command to take a snapshot of a group of > devices. This is simlar to the blockdev-snapshot-sync command, except s/simlar/similar/ > blockdev-group-snapshot-sync accepts a list devices, filenames, and > formats. >=20 > It is attempted to keep the snapshot of the group atomic; if > any snapshot of a device in a given group fails, then the whole group > is reverted back to its original image, and error is reported. >=20 > This allows the group of disks to remain consistent with each other, > even across snapshot failures. >=20 > Signed-off-by: Jeff Cody > --- > blockdev.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > qapi-schema.json | 45 +++++++++++++++++++ > qmp-commands.hx | 39 ++++++++++++++++ > 3 files changed, 214 insertions(+), 0 deletions(-) > + > +error_rollback: > + /* failure, undo everything as much as we can */ > + QSIMPLEQ_FOREACH(snap_entry, &gsnp_list, entry) { > + if (snap_entry->has_pivoted) { > + ret =3D bdrv_open(snap_entry->bs, snap_entry->old_filename= , > + snap_entry->flags, snap_entry->old_drv); > + if (ret !=3D 0) { > + /* This is very very bad */ > + error_set(errp, QERR_OPEN_FILE_FAILED, > + snap_entry->old_filename); Is there any way to reduce the likelihood of a rollback failure? > +SQMP > +blockdev-group-snapshot-sync > +---------------------- > + > +Synchronous snapshot of one or more block devices. A list array input= > +is accepted, that contains the device, snapshot-file to be create as t= he > +target of the new image. If the file exists, or if it is a device, the= > +snapshot will be created in the existing file/device. If does not > +exist, a new file will be created. format specifies the format of the > +snapshot image, default is qcow2. On failure of any device, it is > +attempted to reopen the original image for all the devices that were > +specified. > + > +Arguments: > + > +- "device": device name to snapshot (json-string) > +- "snapshot-file": name of new image file (json-string) > +- "format": format of new image (json-string, optional) Shouldn't this mention that the arguments is a JSON list, rather than a single argument? > + > +Example: > + > +-> { "execute": "blockdev-group-snapshot-sync", "arguments": [{ "devic= e": "ide-hd0", > + "snaps= hot-file": > + "/some= /place/my-image", > + "forma= t": "qcow2" }, > + { "devic= e": "ide-hd1", > + "snaps= hot-file": > + "/some= /place/my-image2", > + "forma= t": "qcow2" } } Are you missing a ']' before the final '}' here? --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig63F09EA95B74C482BAD6C897 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/ iQEcBAEBCAAGBQJPQoXYAAoJEKeha0olJ0NqooQH/jNqvLAv7x4uVbDhQVWYtKiA 693gqK/UsdDgpwhmIg61kK2pmHLTBWFMyVhCSTfDwICqrOYt5QZMm9zz6kikKMSh qMpe/FXiOQSz50Gn4v05PO5M5yuUHBP1MXI0z/rCYD1a/ACjsMwLGXbAzp+GGi6t bpNMdhUXN4jUG8u0COH1o8agUtUkLC8YcfgmbeUtov1jeMjX937NdbNUmOMcqfDx gYPQx9vXmbyv18qvoinFSXlBYGOKT6p/zkmVeFH8WhkFH1b+B6cf232W+mv2W1mz Wm00mepgTSHLqPlT9q3BghiWyCGNz6rgEkEO3mPnVd0o4GikJCLtsxs6ZhFj1Wg= =pYjt -----END PGP SIGNATURE----- --------------enig63F09EA95B74C482BAD6C897--