From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ud3k8-00078r-UY for qemu-devel@nongnu.org; Thu, 16 May 2013 15:21:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ud3k4-0007Lb-0g for qemu-devel@nongnu.org; Thu, 16 May 2013 15:21:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ud3k3-0007LV-NN for qemu-devel@nongnu.org; Thu, 16 May 2013 15:21:31 -0400 Message-ID: <519531AF.2050202@redhat.com> Date: Thu, 16 May 2013 13:21:19 -0600 From: Eric Blake MIME-Version: 1.0 References: <1368693379-8434-1-git-send-email-stefanha@redhat.com> <1368693379-8434-7-git-send-email-stefanha@redhat.com> In-Reply-To: <1368693379-8434-7-git-send-email-stefanha@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2XTWQNVVAKDUVLAJBTALN" Subject: Re: [Qemu-devel] [PATCH v4 6/8] blockdev: add DriveBackup transaction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Fam Zheng , qemu-devel@nongnu.org, dietmar@proxmox.com, imain@redhat.com, Paolo Bonzini , xiawenc@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2XTWQNVVAKDUVLAJBTALN Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/16/2013 02:36 AM, Stefan Hajnoczi wrote: > This patch adds a transactional version of the drive-backup QMP command= =2E > It allows atomic snapshots of multiple drives along with automatic > cleanup if there is a failure to start one of the backup jobs. >=20 > Note that QMP events are emitted for block job completion/cancellation > and the block job will be listed by query-block-jobs. >=20 > @DriveBackup >=20 > @device: the name of the device whose writes should be mirrored. >=20 > @target: the target of the new image. If the file exists, or if it > is a device, the existing file/device will be used as the new > destination. If it does not exist, a new file will be created= =2E >=20 > @format: #optional the format of the new destination, default is to > probe if @mode is 'existing', else the format of the source >=20 > @mode: #optional whether and how QEMU should create a new image, defaul= t is > 'absolute-paths'. >=20 > @speed: #optional the maximum speed, in bytes per second >=20 > Signed-off-by: Stefan Hajnoczi > --- > blockdev.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++= +++++ > qapi-schema.json | 26 +++++++++++++++++++++++++- > 2 files changed, 78 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake Hmm, I wonder if we can simplify patch 3/8, by hoisting the DriveBackup definition into that patch, and writing: { 'command': 'drive-backup', 'data': 'DriveBackup' } instead of the current open-coding repetition of the arguments for the standalone command in comparison to the transaction action. So far, all uses of { 'command':'str', 'data':{...} } in the qapi-schema.json use a direct object instead of a named type, but if we could fix the qapi code generation to honor dictionary types in place of an open-coded type, it might make our interface file more compact. > + > +static void drive_backup_commit(BlkTransactionState *common) > +{ > + /* Block job has started, nothing to do here */ > +} Given this implementation, should we modify the extensible transaction series to allow for a NULL commit callback, and merely insist only that at least one of commit/abort is non-NULL (rather than the current insistence that commit is mandatory and abort is optional)? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2XTWQNVVAKDUVLAJBTALN 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.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRlTGvAAoJEKeha0olJ0NqiAMH/inccRGq+JcYHvHauNmyWi22 OUUPQryBR5odnEak4JHf4FB9IKm1wdvJC3iPB/3SQIoO3OJosueD9cYnwNQ8c68X kGFAwktfFhvG312gr+Gdc29yGEH6/7cwxGQ64XsxaLEWY59oJNi8d5A2wdVOzgm2 pOmhvKwTF8aBN9WQbUPqe06780oUMzqVtp6exaYJ4DdSnLBQvtTXW2wcIxQicabb cz4V5XF9Dxe+1RuchNW6n0wjRZUe3zKy3Z4B2P8z2c/MpOtoAMZVl/lX+eA0pNVC yHu3q7g0MRPM/STf1vpiOXQ0tYTDgvx2G0vb74MtmMI2uK/2Y4eQ4VQPAjVtfOU= =w0Hq -----END PGP SIGNATURE----- ------enig2XTWQNVVAKDUVLAJBTALN--