From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tjcml-0005cg-OS for qemu-devel@nongnu.org; Fri, 14 Dec 2012 16:27:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tjcmh-0005RL-L8 for qemu-devel@nongnu.org; Fri, 14 Dec 2012 16:27:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tjcmh-0005RH-DC for qemu-devel@nongnu.org; Fri, 14 Dec 2012 16:27:07 -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 qBELR6IB031376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Dec 2012 16:27:06 -0500 Message-ID: <50CB99A8.2030606@redhat.com> Date: Fri, 14 Dec 2012 14:27:04 -0700 From: Eric Blake MIME-Version: 1.0 References: <1355319999-30627-1-git-send-email-pbonzini@redhat.com> <1355319999-30627-8-git-send-email-pbonzini@redhat.com> In-Reply-To: <1355319999-30627-8-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig506A13CC601B488C5D238349" Subject: Re: [Qemu-devel] [PATCH 07/20] block: allow customizing the granularity of the dirty bitmap 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) --------------enig506A13CC601B488C5D238349 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/12/2012 06:46 AM, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > block-migration.c | 5 +++-- > block.c | 17 ++++++++++------- > block.h | 5 +---- > block/mirror.c | 14 ++++---------- > qapi-schema.json | 4 +++- > 5 files changed, 21 insertions(+), 24 deletions(-) >=20 > @@ -4218,16 +4220,17 @@ void *qemu_blockalign(BlockDriverState *bs, siz= e_t size) > return qemu_memalign((bs && bs->buffer_alignment) ? bs->buffer_ali= gnment : 512, size); > } > =20 > -void bdrv_set_dirty_tracking(BlockDriverState *bs, int enable) > +void bdrv_set_dirty_tracking(BlockDriverState *bs, int granularity) > { > int64_t bitmap_size; > =20 > - if (enable) { > - if (!bs->dirty_bitmap) { > - bitmap_size =3D (bdrv_getlength(bs) >> BDRV_SECTOR_BITS); > - bs->dirty_bitmap =3D hbitmap_alloc(bitmap_size, > - BDRV_LOG_SECTORS_PER_DIRT= Y_CHUNK); > - } > + assert((granularity & (granularity - 1)) =3D=3D 0); > + > + if (granularity) { > + granularity >>=3D BDRV_SECTOR_BITS; Given that granularity is specified in bytes, does it make sense for a user to want a granularity of 4G? I guess another way of wording this question is: Are you sure 'int granularity' is the right type? > +++ b/qapi-schema.json > @@ -667,10 +667,12 @@ > # > # @count: number of dirty bytes according to the dirty bitmap > # > +# @granularity: granularity of the dirty bitmap in bytes Mention that this field was added in 1.4. > +# > # Since: 1.3 > ## > { 'type': 'BlockDirtyInfo', > - 'data': {'count': 'int'} } > + 'data': {'count': 'int', 'granularity': 'int'} } > =20 > ## > # @BlockInfo: >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig506A13CC601B488C5D238349 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/ iQEcBAEBCAAGBQJQy5mpAAoJEKeha0olJ0Nq040IAKW22Qh9Gj7jqLDax/FTK/Xr kCBAktlEyj1Nv115mq3DdXUm1OTYJPerHYk6pe+pYXRIHcNd36GzCCWum6MO0+Y5 uEpDUfgWDytR2rIYNWSqhr9cuXKqRXvEIobmkqolZd3uBFxBNFoMyPmXTqDcn95O q3E1c6QeHLtgOFrKvVxE7YvDMnllqGheYTu8/6ayWsFKhNxHfb9uS6Gv5tbmR3rd grBFn95xPRqor2ZpLYx4jUMMhOq4BKGOwo9qCqOQVcb7F/cE/63TBRsO3gh3lMEe 3yw1G3cW8m13kVfXhaFOO0cc0HwTUCBY7w9yplnvA5iWtFppdNzRB/rpb5DwF44= =8hHw -----END PGP SIGNATURE----- --------------enig506A13CC601B488C5D238349--