From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1xwV-0003vL-T0 for qemu-devel@nongnu.org; Mon, 08 Jun 2015 10:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1xwU-0007Wy-QL for qemu-devel@nongnu.org; Mon, 08 Jun 2015 10:22:23 -0400 Message-ID: <5575A502.2000204@redhat.com> Date: Mon, 08 Jun 2015 08:21:54 -0600 From: Eric Blake MIME-Version: 1.0 References: <1433759662-25139-1-git-send-email-famz@redhat.com> <1433759662-25139-3-git-send-email-famz@redhat.com> In-Reply-To: <1433759662-25139-3-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ePeL6MJQ6rmFVRtLCo4A1cSjS5Mev93fI" Subject: Re: [Qemu-devel] [PATCH v2 2/3] qapi: Add "detect-zeroes" option to drive-mirror List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, Jeff Cody , Markus Armbruster , stefanha@redhat.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ePeL6MJQ6rmFVRtLCo4A1cSjS5Mev93fI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/08/2015 04:34 AM, Fam Zheng wrote: > The new optional flag defaults to true, in which case, mirror job would= > check the read sectors and use sparse write if they are zero. Otherwis= e > data will be fully copied. Is that a different default than in qemu 2.3? That's okay, but I need to figure out how to probe if qemu supports the new flag for libvirt to know to set it. I'm hoping Markus' work on introspection might save the day... >=20 > Signed-off-by: Fam Zheng > --- > blockdev.c | 26 +++++++++++++++++++++++++- > hmp.c | 2 +- > qapi/block-core.json | 4 +++- > qmp-commands.hx | 4 +++- > 4 files changed, 32 insertions(+), 4 deletions(-) >=20 > diff --git a/blockdev.c b/blockdev.c > index 5ad6960..3d008a2 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -2622,6 +2622,7 @@ void qmp_drive_mirror(const char *device, const c= har *target, > bool has_on_source_error, BlockdevOnError on_sou= rce_error, > bool has_on_target_error, BlockdevOnError on_tar= get_error, > bool has_unmap, bool unmap, > + bool has_detect_zeroes, bool detect_zeroes, Again, as I mentioned on 1/3, I think a tri-state enum might be easier to use than two competing bools. In fact, it might be more than tri-state. What are our possibilities? 1. We want the dest to be fully allocated, regardless of the source being sparse 2. We want the dest to be as sparse as possible, regardless of the source being fully allocated (or at least being unable to tell us about holes) 3. We want the dest to mirror the sparseness of the host, but only where that is efficient (if the source reads holes, make a hole in the dest) 4. Any other modes? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ePeL6MJQ6rmFVRtLCo4A1cSjS5Mev93fI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVdaUCAAoJEKeha0olJ0NqS30H/02WWPMERtHczhozVoL0IJgq tZ6ddvixXaAzENRN7ATEe/nCpZRxKM68sFKlTcwf+xC2JwMNRoSzN0mc2xktTF6e /DVlvHUMM0mm9OTv0vV9AIf9EBrdw86VvQHRIXuf8OLJEsVnZ6s7qB8E8OSqssJu jzAkQjvXYNTXz972733LDCDDUrTHYUQidveKQTdTSlW40zHqaCPFmsQYpu9pxxY3 LEK8qVtnI3RzpXrddMaxrLioDOTyiCsZshfE+tJ14tibL5xpePtC2XfLGHb/5UGY 2hQhdXOQcKprUzC1eFh/GBkiat3glCtNeY3wCUSihHKFBS+LRnB7EvRU8F+tYUg= =Y64p -----END PGP SIGNATURE----- --ePeL6MJQ6rmFVRtLCo4A1cSjS5Mev93fI--