From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbPt8-0005Xl-8X for qemu-devel@nongnu.org; Wed, 30 Oct 2013 03:08:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbPt2-0002zk-64 for qemu-devel@nongnu.org; Wed, 30 Oct 2013 03:08:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbPt1-0002zf-Ut for qemu-devel@nongnu.org; Wed, 30 Oct 2013 03:08:16 -0400 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 r9U78FEV030262 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Oct 2013 03:08:15 -0400 From: Fam Zheng Date: Wed, 30 Oct 2013 15:08:09 +0800 Message-Id: <1383116892-11047-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH 0/3] block: per caller dirty bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com Previously a BlockDriverState has only one dirty bitmap (bs->dirty_bitmap), consequently only one caller can keep track of writings with it. This limit is removed by this series. This is useful for implementing features like incremental backup, which may require multiple dirty bitmap callers for one BDS. The bs->dirty_bitmap is changed to QLIST of HBitmap as bs->dirty_bitmaps, while still maintained by block.c. The caller calls bdrv_create_dirty_bitmap() to allocate a dirty bitmap and releases it after use by bdrv_release_dirty_bitmap(). Block.c automatically sets dirty bits just like existing code, but to all the dirty bitmaps in the BDS. That way the caller doesn't need to register a callback and update dirty bit explicitly. Fam Zheng (3): HBitmap: move struct HBitmap to header HBitmap: add QLIST_ENTRY to HBitmap block: per caller dirty bitmap block-migration.c | 22 ++++++++++---- block.c | 74 ++++++++++++++++++++++++++--------------------- block/mirror.c | 23 ++++++++------- block/qapi.c | 8 ----- include/block/block.h | 11 ++++--- include/block/block_int.h | 2 +- include/qemu/hbitmap.h | 42 +++++++++++++++++++++++++++ util/hbitmap.c | 38 ------------------------ 8 files changed, 120 insertions(+), 100 deletions(-) -- 1.8.3.1