All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, fam@euphon.net, vsementsov@virtuozzo.com,
	stefanha@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org,
	dgilbert@redhat.com, mreitz@redhat.com,
	Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>,
	pavel.dovgaluk@ispras.ru, den@openvz.org, pbonzini@redhat.com,
	jsnow@redhat.com
Subject: [PATCH v3 3/7] block/dirty-bitmap: add bdrv_has_named_bitmaps helper
Date: Fri, 15 May 2020 15:40:20 +0300	[thread overview]
Message-ID: <20200515124024.3491-4-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20200515124024.3491-1-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>
---
 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 8a10029418..eee70df873 100644
--- a/include/block/dirty-bitmap.h
+++ b/include/block/dirty-bitmap.h
@@ -94,6 +94,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 063793e316..c788ca7c69 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -809,6 +809,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.21.0



  parent reply	other threads:[~2020-05-15 12:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 12:40 [PATCH v3 0/7] fix migration with bitmaps and mirror Vladimir Sementsov-Ogievskiy
2020-05-15 12:40 ` [PATCH v3 1/7] block: Mark commit, mirror, blkreplay as filters Vladimir Sementsov-Ogievskiy
2020-05-15 12:40 ` [PATCH v3 2/7] migration/block-dirty-bitmap: refactor init_dirty_bitmap_migration Vladimir Sementsov-Ogievskiy
2020-05-15 12:40 ` Vladimir Sementsov-Ogievskiy [this message]
2020-05-15 12:40 ` [PATCH v3 4/7] migration/block-dirty-bitmap: fix bitmaps pre-blockdev migration during mirror job Vladimir Sementsov-Ogievskiy
2020-05-18 20:36   ` Eric Blake
2020-05-19 10:51     ` Vladimir Sementsov-Ogievskiy
2020-05-21 21:01       ` Eric Blake
2020-05-15 12:40 ` [PATCH v3 5/7] iotests: 194: test also migration of dirty bitmap Vladimir Sementsov-Ogievskiy
2020-05-21 21:10   ` Eric Blake
2020-05-15 12:40 ` [PATCH v3 6/7] migration/block-dirty-bitmap: add_bitmaps_to_list: check disk name once Vladimir Sementsov-Ogievskiy
2020-05-21 21:09   ` Eric Blake
2020-05-15 12:40 ` [PATCH v3 7/7] migration/block-dirty-bitmap: forbid migration by generated node-name Vladimir Sementsov-Ogievskiy
2020-05-21 21:05   ` 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=20200515124024.3491-4-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=andrey.shinkevich@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=dgilbert@redhat.com \
    --cc=fam@euphon.net \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pavel.dovgaluk@ispras.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=stefanha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.