From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xla6y-00052r-9p for qemu-devel@nongnu.org; Tue, 04 Nov 2014 04:09:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xla6s-0003z2-61 for qemu-devel@nongnu.org; Tue, 04 Nov 2014 04:09:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xla6r-0003yu-U2 for qemu-devel@nongnu.org; Tue, 04 Nov 2014 04:09:06 -0500 Message-ID: <5458979F.4050609@redhat.com> Date: Tue, 04 Nov 2014 10:08:47 +0100 From: Max Reitz MIME-Version: 1.0 References: <1414639364-4499-1-git-send-email-famz@redhat.com> <1414639364-4499-2-git-send-email-famz@redhat.com> In-Reply-To: <1414639364-4499-2-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 01/10] qapi: Add optional field "name" to block dirty bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Benoit Canet , Vladimir Sementsov-Ogievskij , Markus Armbruster , Luiz Capitulino , John Snow , Stefan Hajnoczi , Jd , Paolo Bonzini On 2014-10-30 at 04:22, Fam Zheng wrote: > This field will be set for user created dirty bitmap. Also pass in an > error pointer to bdrv_create_dirty_bitmap, so when a name is already > taken on this BDS, it can report an error message. This is not global > check, two BDSes can have dirty bitmap with a common name. > > Implemented bdrv_find_dirty_bitmap to find a dirty bitmap by name, will > be used later when other QMP commands want to reference dirty bitmap by > name. > > Add bdrv_dirty_bitmap_make_anon. This unsets the name of dirty bitmap. > > Signed-off-by: Fam Zheng > --- > block-migration.c | 2 +- > block.c | 34 +++++++++++++++++++++++++++++++++- > block/mirror.c | 2 +- > include/block/block.h | 7 ++++++- > qapi/block-core.json | 4 +++- > 5 files changed, 44 insertions(+), 5 deletions(-) [snip] > diff --git a/block.c b/block.c > index 88f6d9b..dafde4b 100644 > --- a/block.c > +++ b/block.c > @@ -5307,6 +5337,8 @@ BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs) > info->count = bdrv_get_dirty_count(bs, bm); > info->granularity = > ((int64_t) BDRV_SECTOR_SIZE << hbitmap_granularity(bm->bitmap)); > + info->has_name = !!bm->name; Simply info->has_name = bm->name would have sufficed but it's probably clearer this way. Reviewed-by: Max Reitz