From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuXhx-00047U-GS for qemu-devel@nongnu.org; Thu, 26 Jul 2012 19:43:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuXhw-0004eJ-1e for qemu-devel@nongnu.org; Thu, 26 Jul 2012 19:43:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuXhv-0004e9-ON for qemu-devel@nongnu.org; Thu, 26 Jul 2012 19:43:03 -0400 Message-ID: <5011D603.4090606@redhat.com> Date: Thu, 26 Jul 2012 17:42:59 -0600 From: Eric Blake MIME-Version: 1.0 References: <1343127865-16608-1-git-send-email-pbonzini@redhat.com> <1343127865-16608-29-git-send-email-pbonzini@redhat.com> In-Reply-To: <1343127865-16608-29-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigA7B10FBF91371525989B2C33" Subject: Re: [Qemu-devel] [PATCH 28/47] qmp: add drive-mirror command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA7B10FBF91371525989B2C33 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/24/2012 05:04 AM, Paolo Bonzini wrote: > This adds the monitor commands that start the mirroring job. >=20 > Signed-off-by: Paolo Bonzini > --- > blockdev.c | 133 ++++++++++++++++++++++++++++++++++++++++++++++= ++++++-- > hmp-commands.hx | 21 +++++++++ > hmp.c | 28 ++++++++++++ > hmp.h | 1 + > qapi-schema.json | 35 ++++++++++++++ > qmp-commands.hx | 42 +++++++++++++++++ > trace-events | 2 +- > 7 files changed, 258 insertions(+), 4 deletions(-) This command only allows mirroring from the top or the complete disk, but no intermediate points. That is, given: base <- sn1 <- sn2 I can mirror sn2 in isolation, or the entire chain including base, but I cannot mirror exactly sn1+sn2. Instead, I would have to do a mirror of sn2 then follow up with a partial block-stream to rebase that mirror on top of base. I guess this is okay, but it feels a bit limited to have to do it in two steps instead of one. [Hmm, your later patches introduce the ability to have a persistent mapping file; perhaps this can be exploited to have the user pre-create a mapping file that shows the portions allocated by sn1+sn2 as the starting point, but I'm not there in the patch series yet to know if this is the case.] > +++ b/qapi-schema.json > @@ -1367,6 +1367,41 @@ > 'returns': 'str' } > =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 to > +# probe is @mode is 'existing', else the format of the source= s/probe is/probe if/ > +# > +# @mode: #optional whether and how QEMU should create a new image, def= ault is > +# 'absolute-paths'. > +# > +# @speed: #optional the maximum speed, in bytes per second > +# > +# @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). Is there any reason 'sync' is listed last here, but before 'mode' in the JSON? > +# > +# 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.2 > +## > +{ 'command': 'drive-mirror', > + 'data': { 'device': 'str', 'target': 'str', '*format': 'str', > + 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode', > + '*speed': 'int' } } > + > +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 the forma= t > +of the source. > + > +Arguments: > + > +- "device": device name to operate on (json-string) > +- "target": name of new image file (json-string) > +- "format": format of new image (json-string, optional) > +- "mode": how an image file should be created into the target > + file/device (NewImageMode, optional, default 'absolute-paths') Should we call out all the possible 'NewImageMode' strings here,... > +- "speed": maximum speed of the streaming job, in bytes per second > + (json-int) Mention that this is optional. > +- "sync": what parts of the disk image should be copied to the destina= tion; > + possibilities include "full" for all the disk, "top" for only the se= ctors > + allocated in the topmost image, or "none" to only replicate new I/O > + (MirrorSyncMode). =2E..given that we did the same for all the possible MirrorSyncMode strin= gs? --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigA7B10FBF91371525989B2C33 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/ iQEcBAEBCAAGBQJQEdYDAAoJEKeha0olJ0NqfJkH/1kxmgs3wEazNLP2mxaDm6QB zAsI/Y93t7PovRmHEDeEdxeKltawDOqYZwVMDMOJpe/7XMDKbvsyWm6mRtXepxak g8NbY15rM7JCxmdBEtf6f4ILw35iz7hV+tK2fP6swaB9Bh+fbsSJ3HS2rHkdipJ5 jbUZHEUJXNx4/0M/hjhQjWPhuE6U41lMmwuVI7x9WcVPveTrleUsYaTRc1ntSHVQ zelJRZbOqLwI94hnSbLQaeUmLalXQ+4SoWucnGDxJXycMoGSV3sz+TYNTY1pGHqA QyKBAwrxg6f/qFIvtolaWzmFZdwIWu/IfCFqkLkw5S3Y8IVNAsyCyWqhRGfVr48= =lAOC -----END PGP SIGNATURE----- --------------enigA7B10FBF91371525989B2C33--