From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfcst-0004GU-Bg for qemu-devel@nongnu.org; Fri, 15 Jun 2012 16:12:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sfcsr-0000HU-EP for qemu-devel@nongnu.org; Fri, 15 Jun 2012 16:12:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41820) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfcsr-0000HP-64 for qemu-devel@nongnu.org; Fri, 15 Jun 2012 16:12:41 -0400 Message-ID: <4FDB9734.8080809@redhat.com> Date: Fri, 15 Jun 2012 14:12:36 -0600 From: Eric Blake MIME-Version: 1.0 References: <1339772759-31004-1-git-send-email-pbonzini@redhat.com> <1339772759-31004-24-git-send-email-pbonzini@redhat.com> In-Reply-To: <1339772759-31004-24-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigDBD479F522F6FF0AEF32E3E4" 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: Paolo Bonzini Cc: kwolf@redhat.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDBD479F522F6FF0AEF32E3E4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/15/2012 09:05 AM, Paolo Bonzini wrote: > This adds the monitor commands that start the mirroring job. >=20 > 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(-) >=20 > ## > +# @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 n= ew > +# destination. If it does not exist, a new file will be crea= ted. > +# > +# @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, def= ault is > +# 'absolute-paths'. Indentation. > +# > +# @sync: what parts of the disk image should be copied to the destinat= ion > +# (all the disk, only the sectors allocated in the topmost imag= e, 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 > =20 > { > + .name =3D "drive-mirror", > + .args_type =3D "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 n= ot > +exist, a new file will be created. format specifies the format of the > +mirror image, default is to probe if mode=3D'existing', else qcow2. default is qcow2? Earlier in this patch you said the same format as the source. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigDBD479F522F6FF0AEF32E3E4 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.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJP25c1AAoJEKeha0olJ0NqBrcH/iDWRfbAlmmvtP+6nEFNNq9Y 8EEOTAxl3BqYw9mFb2aF8g9iBpduJj98tRIXcZAwlRLzDmCeUvBHzzTHkmDrIi1t UG2QWANPY4dCcwmY52VCaIo5Ox7hArvL60Qm72n7F8fZyCabXD6SD2AT32r0bQ5K YpQAcO2MYz6sS0C5mxE7AHIMPviZyo7/2gm6CNq/ZTwYb74ggWR0W1KZhenRmvmc nF47EAbQqigCStBT2sv09Wnm2THE2ywC8Sa/VQGbw7bh5yUcj6lN7Nh+rJEZmp+N jLtWQWmWP1v/vCVCFWmUNVTaC4j895hAyYjdLeicrPUj9foTdAqy7iWxCBEN+fU= =KQ/F -----END PGP SIGNATURE----- --------------enigDBD479F522F6FF0AEF32E3E4--