From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tjdee-0002p5-Om for qemu-devel@nongnu.org; Fri, 14 Dec 2012 17:22:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjdeY-0002g7-EK for qemu-devel@nongnu.org; Fri, 14 Dec 2012 17:22:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjdeY-0002fW-6d for qemu-devel@nongnu.org; Fri, 14 Dec 2012 17:22:46 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBEMMilL007196 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Dec 2012 17:22:45 -0500 Message-ID: <50CBA6B3.2040801@redhat.com> Date: Fri, 14 Dec 2012 15:22:43 -0700 From: Eric Blake MIME-Version: 1.0 References: <1355319999-30627-1-git-send-email-pbonzini@redhat.com> <1355319999-30627-11-git-send-email-pbonzini@redhat.com> In-Reply-To: <1355319999-30627-11-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig5E872DAC94843BD33E54AF87" Subject: Re: [Qemu-devel] [PATCH 10/20] mirror: add buf-size argument to drive-mirror 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@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5E872DAC94843BD33E54AF87 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/12/2012 06:46 AM, Paolo Bonzini wrote: > This makes sense when the next commit starts using the extra buffer spa= ce > to perform many I/O operations asynchronously. >=20 > Signed-off-by: Paolo Bonzini > --- > block/mirror.c | 6 +++--- > block_int.h | 5 +++-- > blockdev.c | 9 ++++++++- > hmp.c | 2 +- > qapi-schema.json | 5 ++++- > qmp-commands.hx | 4 +++- > tests/qemu-iotests/041 | 31 +++++++++++++++++++++++++++++++ > 7 files changed, 53 insertions(+), 9 deletions(-) >=20 > @@ -447,7 +447,7 @@ void mirror_start(BlockDriverState *bs, BlockDriver= State *target, > s->target =3D target; > s->mode =3D mode; > s->granularity =3D granularity; > - s->buf_size =3D granularity; > + s->buf_size =3D MAX(buf_size, granularity); So you silently clamp the buffer size if the user gives something larger than granularity. > +++ b/qapi-schema.json > @@ -1641,6 +1641,9 @@ > # are smaller than that, else the cluster size. Must be= a > # power of 2 between 512 and 64M. > # > +# @buf-size: #optional maximum amount of data in flight from source to= > +# target. Mention that it was added in 1.4. Also, is it worth mentioning reasonable bounds (such as granularity), and whether it must be a power of two? > - "granularity": granularity of the dirty bitmap (json-int, optional) > +- "buf_size": maximum amount of data in flight from source to target > + (json-int, default 10M) Oh, so unlike granularity, this one does NOT have to be a power of 2. But why is the default 10M if you clamp it to granularity, which defaults to 64k? (and again, something else I have to figure out how to expose from libvirt) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig5E872DAC94843BD33E54AF87 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 undefined - http://www.enigmail.net/ iQEcBAEBCAAGBQJQy6azAAoJEKeha0olJ0Nq1/UIAKIGaz4WjNqtLdYLI1DDw/12 cPUO3aAfGRi2TGstZUSBunN4Skdsvl873gu0VeWsDeo1XkIoj10gpNvkq2aox2Bj 9byJw/kUfHVwkgS55PXDyrEY6TbdxcNHu+mETvw17zw9/8grTrAHCtSSjU+gcrXT ebWf6Q2V2ekwrzbFX6kf3w1MYSnF/l/zBYf+jSlnRAd9MDOBbfbst5SraStBCKQB 8tKhqetsbj2wG8akZe4TypZKlvxbiIS6t+kNhMommUya5xGmASCNPOT9tAb/fWTS WN4S2w5M6Gv8Lhs/D/vFIjVcpw2vrLMrRsmf9Y5HjBrnorFEG0ME5/pOrCuHs7E= =FPSZ -----END PGP SIGNATURE----- --------------enig5E872DAC94843BD33E54AF87--