From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgBUs-00017e-U7 for qemu-devel@nongnu.org; Tue, 12 Nov 2013 05:47:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgBUm-0005B1-Uq for qemu-devel@nongnu.org; Tue, 12 Nov 2013 05:47:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:3449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgBUm-0005As-LO for qemu-devel@nongnu.org; Tue, 12 Nov 2013 05:46:56 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rACAktFG025161 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 12 Nov 2013 05:46:55 -0500 Date: Tue, 12 Nov 2013 11:46:57 +0100 From: Kevin Wolf Message-ID: <20131112104657.GC2627@dhcp-200-207.str.redhat.com> References: <1383557410-18062-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1383557410-18062-1-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] block: per caller dirty bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Am 04.11.2013 um 10:30 hat Fam Zheng geschrieben: > Previously a BlockDriverState has only one dirty bitmap, so only one > caller (e.g. a block job) can keep track of writing. This changes the > dirty bitmap to a list and creates a BdrvDirtyBitmap for each caller, the > lifecycle is managed with these new functions: > > bdrv_create_dirty_bitmap > bdrv_release_dirty_bitmap > > Where BdrvDirtyBitmap is a linked list wrapper structure of HBitmap. > > In place of bdrv_set_dirty_tracking, a BdrvDirtyBitmap pointer argument > is added to these functions, since each caller has its own dirty bitmap: > > bdrv_get_dirty > bdrv_dirty_iter_init > bdrv_get_dirty_count > > bdrv_set_dirty and bdrv_reset_dirty prototypes are unchanged but will > internally walk the list of all dirty bitmaps and set them one by one. > > Signed-off-by: Fam Zheng > diff --git a/block/qapi.c b/block/qapi.c > index 5880b3e..6b0cdcf 100644 > --- a/block/qapi.c > +++ b/block/qapi.c > @@ -204,14 +204,6 @@ void bdrv_query_info(BlockDriverState *bs, > info->io_status = bs->iostatus; > } > > - if (bs->dirty_bitmap) { > - info->has_dirty = true; > - info->dirty = g_malloc0(sizeof(*info->dirty)); > - info->dirty->count = bdrv_get_dirty_count(bs) * BDRV_SECTOR_SIZE; > - info->dirty->granularity = > - ((int64_t) BDRV_SECTOR_SIZE << hbitmap_granularity(bs->dirty_bitmap)); > - } > - > if (bs->drv) { > info->has_inserted = true; > info->inserted = g_malloc0(sizeof(*info->inserted)); The dirty field should probably be removed from qapi-schema.json if it never gets set any more. It was optional, so perhaps removing it doesn't cause any trouble indeed, but I'd like to hear Eric on this matter before merging the patch. Though if libvirt does make use of it, we have a problem because it doesn't really make sense any more after these changes. Kevin