Received: from eggs.gnu.org ([2001:4830:134:3::10]:45751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkuAy-0004bI-EH for qemu-devel@nongnu.org; Mon, 25 Nov 2013 06:18:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VkuAs-0007bf-E3 for qemu-devel@nongnu.org; Mon, 25 Nov 2013 06:18:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkuAs-0007bb-5C for qemu-devel@nongnu.org; Mon, 25 Nov 2013 06:17:54 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAPBHrPn002453 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 25 Nov 2013 06:17:53 -0500 Date: Mon, 25 Nov 2013 12:17:53 +0100 From: Kevin Wolf Message-ID: <20131125111753.GF3009@dhcp-200-207.str.redhat.com> References: <1385097894-1380-1-git-send-email-famz@redhat.com> <1385097894-1380-7-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1385097894-1380-7-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 6/7] qmp: add command 'blockdev-backup' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: hbrock@redhat.com, qemu-devel@nongnu.org, rjones@redhat.com, imain@redhat.com, stefanha@redhat.com, pbonzini@redhat.com Am 22.11.2013 um 06:24 hat Fam Zheng geschrieben: > 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. > > Signed-off-by: Fam Zheng > diff --git a/qmp-commands.hx b/qmp-commands.hx > index fba15cd..4116a8d 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -963,6 +963,52 @@ Example: > "sync": "full", > "target": "backup.img" } } > <- { "return": {} } > + > +EQMP > + > + { > + .name = "blockdev-backup", > + .args_type = "sync:s,device:B,target:B,speed:i?," > + "on-source-error:s?,on-target-error:s?", > + .mhandler.cmd_new = qmp_marshal_input_blockdev_backup, > + }, > + > +SQMP > +blockdev-backup > +------------ > + > +The device version of drive-backup: this command takes a existing named device > +as backup target. > + > +Arguments: > + > +- "device": the name of the device which should be copied. > + (json-string) > +- "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. > + (json-string) > +- "sync": what parts of the disk image should be copied to the destination; > + possibilities include "full" for all the disk, "top" for only the sectors > + allocated in the topmost image, or "none" to only replicate new I/O > + (MirrorSyncMode). What happened to the indentation? > +- "mode": whether and how QEMU should create a new image > + (NewImageMode, optional, default 'absolute-paths') "mode" doesn't exist for blockdev-backup. > +- "speed": the maximum speed, in bytes per second (json-int, optional) > +- "on-source-error": 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. > + (BlockdevOnError, optional) > +- "on-target-error": the action to take on an error on the target, default > + 'report' (no limitations, since this applies to > + a different block device than device). > + (BlockdevOnError, optional) > + > +Example: > +-> { "execute": "blockdev-backup", "arguments": { "device": "src-id", > + "target": "tgt-id" } } > +<- { "return": {} } > + > EQMP Kevin