qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	"open list:Dirty Bitmaps" <qemu-block@nongnu.org>,
	Max Reitz <mreitz@redhat.com>,
	Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>,
	John Snow <jsnow@redhat.com>
Subject: [PULL 02/11] block/dirty-bitmap: add bdrv_has_named_bitmaps helper
Date: Tue, 26 May 2020 11:42:02 -0500	[thread overview]
Message-ID: <20200526164211.1569366-3-eblake@redhat.com> (raw)
In-Reply-To: <20200526164211.1569366-1-eblake@redhat.com>

From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

To be used for bitmap migration in further commit.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200521220648.3255-3-vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 include/block/dirty-bitmap.h |  1 +
 block/dirty-bitmap.c         | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h
index 5a8d52e4deaf..36e8da4fc2e3 100644
--- a/include/block/dirty-bitmap.h
+++ b/include/block/dirty-bitmap.h
@@ -95,6 +95,7 @@ int64_t bdrv_get_dirty_count(BdrvDirtyBitmap *bitmap);
 void bdrv_dirty_bitmap_truncate(BlockDriverState *bs, int64_t bytes);
 bool bdrv_dirty_bitmap_readonly(const BdrvDirtyBitmap *bitmap);
 bool bdrv_has_readonly_bitmaps(BlockDriverState *bs);
+bool bdrv_has_named_bitmaps(BlockDriverState *bs);
 bool bdrv_dirty_bitmap_get_autoload(const BdrvDirtyBitmap *bitmap);
 bool bdrv_dirty_bitmap_get_persistence(BdrvDirtyBitmap *bitmap);
 bool bdrv_dirty_bitmap_inconsistent(const BdrvDirtyBitmap *bitmap);
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index f9bfc77985e8..c01319b188c3 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -818,6 +818,19 @@ bool bdrv_has_readonly_bitmaps(BlockDriverState *bs)
     return false;
 }

+bool bdrv_has_named_bitmaps(BlockDriverState *bs)
+{
+    BdrvDirtyBitmap *bm;
+
+    QLIST_FOREACH(bm, &bs->dirty_bitmaps, list) {
+        if (bdrv_dirty_bitmap_name(bm)) {
+            return true;
+        }
+    }
+
+    return false;
+}
+
 /* Called with BQL taken. */
 void bdrv_dirty_bitmap_set_persistence(BdrvDirtyBitmap *bitmap, bool persistent)
 {
-- 
2.26.2



  parent reply	other threads:[~2020-05-26 16:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 16:42 [PULL 00/11] bitmaps patches for 2020-05-26 Eric Blake
2020-05-26 16:42 ` [PULL 01/11] migration: refactor init_dirty_bitmap_migration Eric Blake
2020-05-26 16:42 ` Eric Blake [this message]
2020-05-26 16:42 ` [PULL 03/11] migration: fix bitmaps pre-blockdev migration with mirror job Eric Blake
2020-05-26 16:42 ` [PULL 04/11] iotests: 194: test also migration of dirty bitmap Eric Blake
2020-05-26 16:42 ` [PULL 05/11] migration: add_bitmaps_to_list: check disk name once Eric Blake
2020-05-26 16:42 ` [PULL 06/11] migration: forbid bitmap migration by generated node-name Eric Blake
2020-05-26 16:42 ` [PULL 07/11] iotests: Fix test 178 Eric Blake
2020-05-26 16:42 ` [PULL 08/11] qcow2: Expose bitmaps' size during measure Eric Blake
2020-05-26 16:42 ` [PULL 09/11] qemu-img: Factor out code for merging bitmaps Eric Blake
2020-05-26 16:42 ` [PULL 10/11] qemu-img: Add convert --bitmaps option Eric Blake
2020-05-26 16:42 ` [PULL 11/11] iotests: Add test 291 to for qemu-img bitmap coverage Eric Blake
2020-05-27 20:07 ` [PULL 00/11] bitmaps patches for 2020-05-26 Peter Maydell
2020-05-27 20:32   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200526164211.1569366-3-eblake@redhat.com \
    --to=eblake@redhat.com \
    --cc=andrey.shinkevich@virtuozzo.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).