From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sozhl-0000ei-PJ for qemu-devel@nongnu.org; Wed, 11 Jul 2012 12:24:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sozhb-0001yg-Of for qemu-devel@nongnu.org; Wed, 11 Jul 2012 12:23:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sozhb-0001ya-GE for qemu-devel@nongnu.org; Wed, 11 Jul 2012 12:23:47 -0400 Message-ID: <4FFDA88C.6040903@redhat.com> Date: Wed, 11 Jul 2012 18:23:40 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1339772759-31004-1-git-send-email-pbonzini@redhat.com> <1339772759-31004-24-git-send-email-pbonzini@redhat.com> <4FDB9734.8080809@redhat.com> In-Reply-To: <4FDB9734.8080809@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 23/36] qmp: add drive-mirror command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com Il 15/06/2012 22:12, Eric Blake ha scritto: > On 06/15/2012 09:05 AM, Paolo Bonzini wrote: >> > This adds the monitor commands that start the mirroring job. >> > >> > Signed-off-by: Paolo Bonzini >> > --- >> > blockdev.c | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- >> > hmp-commands.hx | 21 ++++++++++ >> > hmp.c | 28 +++++++++++++ >> > hmp.h | 1 + >> > qapi-schema.json | 33 +++++++++++++++ >> > qmp-commands.hx | 41 +++++++++++++++++++ >> > trace-events | 2 +- >> > 7 files changed, 242 insertions(+), 4 deletions(-) >> > >> > ## >> > +# @drive-mirror >> > +# >> > +# Start mirroring a block device's writes to a new destination. >> > +# >> > +# @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 the >> > +# format of the source >> > +# >> > +# @mode: #optional whether and how QEMU should create a new image, default is >> > +# 'absolute-paths'. > Indentation. > >> > +# >> > +# @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). > Document @peed:. > >> > +# >> > +# Returns: nothing on success >> > +# If @device is not a valid block device, DeviceNotFound >> > +# If @target can't be opened, OpenFileFailed >> > +# If @format is invalid, InvalidBlockFormat >> > +# >> > +# Since 1.1 > 1.2 > >> > +## >> > +{ 'command': 'drive-mirror', >> > + 'data': { 'device': 'str', 'target': 'str', '*format': 'str', >> > + 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode', >> > + '*speed': 'int' } } >> > + >> > +## >> > # @migrate_cancel >> > # >> > # Cancel the current executing migration process. >> > diff --git a/qmp-commands.hx b/qmp-commands.hx >> > index e2d77b6..cccea2f 100644 >> > --- a/qmp-commands.hx >> > +++ b/qmp-commands.hx >> > @@ -832,6 +832,47 @@ Example: >> > EQMP >> > >> > { >> > + .name = "drive-mirror", >> > + .args_type = "sync:s,device:B,target:s,sync:s?,format:s?", > sync: twice? and no speed: or mode:? > > >> > +SQMP >> > +drive-mirror >> > +------------ >> > + >> > +Start mirroring a block device's writes to a new destination. target >> > +specifies the target of the new image. If the file exists, or if it is >> > +a device, it will be used as the new destination for writes. If does not >> > +exist, a new file will be created. format specifies the format of the >> > +mirror image, default is to probe if mode='existing', else qcow2. > default is qcow2? Earlier in this patch you said the same format as the > source. Indeed, thanks for pointing out all the inconsistencies. Paolo