From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXQ27-000607-Vm for qemu-devel@nongnu.org; Tue, 08 Apr 2014 03:01:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXQ21-0008TV-Qi for qemu-devel@nongnu.org; Tue, 08 Apr 2014 03:01:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXQ21-0008PS-Il for qemu-devel@nongnu.org; Tue, 08 Apr 2014 03:01:17 -0400 Date: Tue, 8 Apr 2014 15:00:53 +0800 From: Fam Zheng Message-ID: <20140408070053.GC11793@T430.redhat.com> References: <1394436370-8908-1-git-send-email-famz@redhat.com> <1394436370-8908-11-git-send-email-famz@redhat.com> <53431393.8070304@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53431393.8070304@redhat.com> Subject: Re: [Qemu-devel] [PATCH v17 10/14] qmp: Add command 'blockdev-backup' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, benoit.canet@irqsave.net, rjones@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, imain@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, ptoscano@redhat.com On Mon, 04/07 15:07, Eric Blake wrote: > On 03/10/2014 01:26 AM, Fam Zheng wrote: > > Similar to drive-backup, but this command uses a device id as target > > instead of creating/opening an image file. > > > > Also add blocker on target bs, since the target is also a named device > > now. > > > > Add check and report error for bs == target which became possible but is > > an illegal case with introduction of blockdev-backup. > > > > Signed-off-by: Fam Zheng > > --- > > block/backup.c | 26 ++++++++++++++++++++++++++ > > blockdev.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ > > qapi-schema.json | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ > > qmp-commands.hx | 44 ++++++++++++++++++++++++++++++++++++++++++++ > > 4 files changed, 166 insertions(+) > > Reviewing just QAPI portion: > > > > +++ b/qapi-schema.json > > @@ -1919,6 +1919,40 @@ > > '*on-target-error': 'BlockdevOnError' } } > > > > ## > > +# @BlockdevBackup > > +# > > +# @device: the name of the device which should be copied. > > +# > > +# @target: the name of the backup target device. > > +# > > +# @sync: what parts of the disk image should be copied to the destination > > +# (all the disk, only the sectors allocated in the topmost image, or > > +# only new I/O). > > +# > > +# @speed: #optional the maximum speed, in bytes per second. > > +# > > +# @on-source-error: #optional the action to take on an error on the source, > > +# default 'report'. 'stop' and 'enospc' can only be used > > +# if the block device supports io-status (see BlockInfo). > > +# > > +# @on-target-error: #optional the action to take on an error on the target, > > +# default 'report' (no limitations, since this applies to > > +# a different block device than @device). > > +# > > +# Note that @on-source-error and @on-target-error only affect background I/O. > > +# If an error occurs during a guest write request, the device's rerror/werror > > +# actions will be used. > > +# > > +# Since: 2.0 > > 2.1 now > > > +## > > +{ 'type': 'BlockdevBackup', > > + 'data': { 'device': 'str', 'target': 'str', > > + 'sync': 'MirrorSyncMode', > > + '*speed': 'int', > > + '*on-source-error': 'BlockdevOnError', > > + '*on-target-error': 'BlockdevOnError' } } > > + > > Looks reasonable > > > > +# If @device or @target is not a valid block device, DeviceNotFound. > > +# > > +# Since 2.0 > > +## > > +{ 'command': 'blockdev-backup', 'data': 'BlockdevBackup' } > > Another case of 2.1 Yes, thanks! Fam