From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtbia-0006mt-22 for qemu-devel@nongnu.org; Wed, 26 Nov 2014 07:29:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtbiZ-0000vn-0I for qemu-devel@nongnu.org; Wed, 26 Nov 2014 07:29:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtbiY-0000vR-E0 for qemu-devel@nongnu.org; Wed, 26 Nov 2014 07:29:10 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAQCT8E5013405 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 26 Nov 2014 07:29:09 -0500 Message-ID: <5475C792.903@redhat.com> Date: Wed, 26 Nov 2014 13:29:06 +0100 From: Max Reitz MIME-Version: 1.0 References: <1416944800-17919-1-git-send-email-jsnow@redhat.com> <1416944800-17919-4-git-send-email-jsnow@redhat.com> In-Reply-To: <1416944800-17919-4-git-send-email-jsnow@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [2.3 PATCH v7 03/10] block: Introduce bdrv_dirty_bitmap_granularity() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-devel@nongnu.org Cc: Fam Zheng On 2014-11-25 at 20:46, John Snow wrote: > From: Fam Zheng > > This returns the granularity (in bytes) of dirty bitmap, > which matches the QMP interface and the existing query > interface. > > Signed-off-by: Fam Zheng > Reviewed-by: Benoit Canet Maybe you should have removed the R-b because of the functional changes,=20 but Beno=EEt should complain about that, not me. > Signed-off-by: John Snow > --- > block.c | 9 +++++++-- > include/block/block.h | 2 ++ > 2 files changed, 9 insertions(+), 2 deletions(-) > > diff --git a/block.c b/block.c > index a940345..ea4c8d8 100644 > --- a/block.c > +++ b/block.c > @@ -5364,8 +5364,7 @@ BlockDirtyInfoList *bdrv_query_dirty_bitmaps(Bloc= kDriverState *bs) > BlockDirtyInfo *info =3D g_new0(BlockDirtyInfo, 1); > BlockDirtyInfoList *entry =3D g_new0(BlockDirtyInfoList, 1); > info->count =3D bdrv_get_dirty_count(bs, bm); > - info->granularity =3D > - ((int64_t) BDRV_SECTOR_SIZE << hbitmap_granularity(bm->bit= map)); > + info->granularity =3D bdrv_dirty_bitmap_granularity(bs, bm); > info->has_name =3D !!bm->name; > info->name =3D g_strdup(bm->name); > entry->value =3D info; > @@ -5404,6 +5403,12 @@ int64_t bdrv_dbm_calc_def_granularity(BlockDrive= rState *bs) > return granularity; > } > =20 > +int64_t bdrv_dirty_bitmap_granularity(BlockDriverState *bs, > + BdrvDirtyBitmap *bitmap) > +{ > + return BDRV_SECTOR_SIZE << hbitmap_granularity(bitmap->bitmap); > +} > + Oh, BDRV_SECTOR_SIZE is an unsigned long long. Great, I didn't know. (So=20 this can't overflow) Reviewed-by: Max Reitz