From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB4gK-0007wX-02 for qemu-devel@nongnu.org; Tue, 13 Jan 2015 11:51:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YB4gF-0008DO-3J for qemu-devel@nongnu.org; Tue, 13 Jan 2015 11:51:03 -0500 Received: from mx2.parallels.com ([199.115.105.18]:38852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB4gE-0008DB-UR for qemu-devel@nongnu.org; Tue, 13 Jan 2015 11:50:59 -0500 Message-ID: <54B54CE8.2060006@parallels.com> Date: Tue, 13 Jan 2015 19:50:48 +0300 From: Vladimir Sementsov-Ogievskiy MIME-Version: 1.0 References: <1421080265-2228-1-git-send-email-jsnow@redhat.com> <1421080265-2228-14-git-send-email-jsnow@redhat.com> In-Reply-To: <1421080265-2228-14-git-send-email-jsnow@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v11 13/13] block: BdrvDirtyBitmap miscellaneous fixup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, armbru@redhat.com, mreitz@redhat.com, stefanha@redhat.com Hmm. May be, update the size field to be uint64_t too? Negative size is not meaningful.. Best regards, Vladimir On 12.01.2015 19:31, John Snow wrote: > (1) granularity type consistency: Update the granularity to be uint64_t > in all places. This value is always in bytes. > > (2) Some documentation for the fields within BdrvDirtyBitmap. > > Signed-off-by: John Snow > --- > block.c | 16 ++++++++-------- > include/block/block.h | 2 +- > 2 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/block.c b/block.c > index 9e2b8c0..13f9cc0 100644 > --- a/block.c > +++ b/block.c > @@ -52,13 +52,13 @@ > #endif > > struct BdrvDirtyBitmap { > - HBitmap *bitmap; > - BdrvDirtyBitmap *successor; > - int64_t size; > - int64_t granularity; > - char *name; > - bool enabled; > - bool frozen; > + HBitmap *bitmap; /* Dirty sector bitmap */ > + BdrvDirtyBitmap *successor; /* Anonymous child */ > + int64_t size; /* Number of sectors */ > + uint64_t granularity; /* Granularity in bytes */ > + char *name; /* Optional non-empty unique ID */ > + bool enabled; /* Writes are being tracked */ > + bool frozen; /* Protected; see bdrv_freeze_dirty_bitmap() */ > QLIST_ENTRY(BdrvDirtyBitmap) list; > }; > > @@ -5350,7 +5350,7 @@ void bdrv_dirty_bitmap_make_anon(BlockDriverState *bs, BdrvDirtyBitmap *bitmap) > } > > BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs, > - int granularity, > + uint64_t granularity, > const char *name, > Error **errp) > { > diff --git a/include/block/block.h b/include/block/block.h > index 99ed679..749429e 100644 > --- a/include/block/block.h > +++ b/include/block/block.h > @@ -430,7 +430,7 @@ bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov); > struct HBitmapIter; > typedef struct BdrvDirtyBitmap BdrvDirtyBitmap; > BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs, > - int granularity, > + uint64_t granularity, > const char *name, > Error **errp); > int bdrv_dirty_bitmap_create_successor(BlockDriverState *bs,