All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
	qemu-devel@nongnu.org, dietmar@proxmox.com, imain@redhat.com,
	Paolo Bonzini <pbonzini@redhat.com>,
	xiawenc@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v4 6/8] blockdev: add DriveBackup transaction
Date: Thu, 16 May 2013 13:21:19 -0600	[thread overview]
Message-ID: <519531AF.2050202@redhat.com> (raw)
In-Reply-To: <1368693379-8434-7-git-send-email-stefanha@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2448 bytes --]

On 05/16/2013 02:36 AM, Stefan Hajnoczi wrote:
> This patch adds a transactional version of the drive-backup QMP command.
> It allows atomic snapshots of multiple drives along with automatic
> cleanup if there is a failure to start one of the backup jobs.
> 
> Note that QMP events are emitted for block job completion/cancellation
> and the block job will be listed by query-block-jobs.
> 
> @DriveBackup
> 
> @device: the name of the device whose writes should be mirrored.
> 
> @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.
> 
> @format: #optional the format of the new destination, default is to
>          probe if @mode is 'existing', else the format of the source
> 
> @mode: #optional whether and how QEMU should create a new image, default is
>        'absolute-paths'.
> 
> @speed: #optional the maximum speed, in bytes per second
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  blockdev.c       | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  qapi-schema.json | 26 +++++++++++++++++++++++++-
>  2 files changed, 78 insertions(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

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)?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

  reply	other threads:[~2013-05-16 19:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16  8:36 [Qemu-devel] [PATCH v4 0/8] block: drive-backup live backup command Stefan Hajnoczi
2013-05-16  8:36 ` [Qemu-devel] [PATCH v4 1/8] block: add bdrv_add_before_write_notifier() Stefan Hajnoczi
2013-05-16  8:36 ` [Qemu-devel] [PATCH v4 2/8] block: add basic backup support to block driver Stefan Hajnoczi
2013-05-22  9:38   ` Kevin Wolf
2013-05-22  9:54     ` Paolo Bonzini
2013-05-22  9:56       ` Kevin Wolf
2013-05-22 13:58         ` Stefan Hajnoczi
2013-05-22 14:08           ` Kevin Wolf
2013-05-16  8:36 ` [Qemu-devel] [PATCH v4 3/8] block: add drive-backup QMP command Stefan Hajnoczi
2013-05-16 19:11   ` Eric Blake
2013-05-22  9:53   ` Kevin Wolf
2013-05-22 14:33     ` Stefan Hajnoczi
2013-05-16  8:36 ` [Qemu-devel] [PATCH v4 4/8] qemu-iotests: add 055 drive-backup test case Stefan Hajnoczi
2013-05-22 11:19   ` Kevin Wolf
2013-05-22 14:34     ` Stefan Hajnoczi
2013-05-16  8:36 ` [Qemu-devel] [PATCH v4 5/8] blockdev: rename BlkTransactionStates to singular Stefan Hajnoczi
2013-05-16  8:36 ` [Qemu-devel] [PATCH v4 6/8] blockdev: add DriveBackup transaction Stefan Hajnoczi
2013-05-16 19:21   ` Eric Blake [this message]
2013-05-17  7:02     ` Stefan Hajnoczi
2013-05-16  8:36 ` [Qemu-devel] [PATCH v4 7/8] blockdev: add Abort transaction Stefan Hajnoczi
2013-05-16 19:23   ` Eric Blake
2013-05-16  8:36 ` [Qemu-devel] [PATCH v4 8/8] qemu-iotests: test 'drive-backup' transaction in 055 Stefan Hajnoczi
2013-05-19 16:47 ` [Qemu-devel] [PATCH v4 0/8] block: drive-backup live backup command Richard W.M. Jones
2013-05-19 19:30   ` Paolo Bonzini
2013-05-19 19:41     ` Richard W.M. Jones
2013-05-22 11:23 ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=519531AF.2050202@redhat.com \
    --to=eblake@redhat.com \
    --cc=dietmar@proxmox.com \
    --cc=famz@redhat.com \
    --cc=imain@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=xiawenc@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.