|
|
1bdc94 |
From b5c5693d22cda0db33d01c6350d790b59a98c92c Mon Sep 17 00:00:00 2001
|
|
|
1bdc94 |
From: John Snow <jsnow@redhat.com>
|
|
|
1bdc94 |
Date: Wed, 18 Jul 2018 22:54:42 +0200
|
|
|
1bdc94 |
Subject: [PATCH 57/89] block/dirty-bitmap: add bdrv_enable_dirty_bitmap_locked
|
|
|
1bdc94 |
|
|
|
1bdc94 |
RH-Author: John Snow <jsnow@redhat.com>
|
|
|
1bdc94 |
Message-id: <20180718225511.14878-7-jsnow@redhat.com>
|
|
|
1bdc94 |
Patchwork-id: 81405
|
|
|
1bdc94 |
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 06/35] block/dirty-bitmap: add bdrv_enable_dirty_bitmap_locked
|
|
|
1bdc94 |
Bugzilla: 1207657
|
|
|
1bdc94 |
RH-Acked-by: Eric Blake <eblake@redhat.com>
|
|
|
1bdc94 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
1bdc94 |
RH-Acked-by: Fam Zheng <famz@redhat.com>
|
|
|
1bdc94 |
|
|
|
1bdc94 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
|
|
|
1bdc94 |
|
|
|
1bdc94 |
Add _locked version of bdrv_enable_dirty_bitmap, to fix dirty bitmap
|
|
|
1bdc94 |
migration in the following patch.
|
|
|
1bdc94 |
|
|
|
1bdc94 |
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
|
|
|
1bdc94 |
Message-id: 20180625165745.25259-2-vsementsov@virtuozzo.com
|
|
|
1bdc94 |
Signed-off-by: John Snow <jsnow@redhat.com>
|
|
|
1bdc94 |
(cherry picked from commit 92bcea40d3aac62853e60426bd109b748d4d1cd2)
|
|
|
1bdc94 |
Signed-off-by: John Snow <jsnow@redhat.com>
|
|
|
1bdc94 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
1bdc94 |
---
|
|
|
1bdc94 |
block/dirty-bitmap.c | 9 +++++++--
|
|
|
1bdc94 |
include/block/dirty-bitmap.h | 1 +
|
|
|
1bdc94 |
2 files changed, 8 insertions(+), 2 deletions(-)
|
|
|
1bdc94 |
|
|
|
1bdc94 |
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
|
|
|
1bdc94 |
index 4159d39..4d6ae8b 100644
|
|
|
1bdc94 |
--- a/block/dirty-bitmap.c
|
|
|
1bdc94 |
+++ b/block/dirty-bitmap.c
|
|
|
1bdc94 |
@@ -250,6 +250,12 @@ int bdrv_dirty_bitmap_create_successor(BlockDriverState *bs,
|
|
|
1bdc94 |
return 0;
|
|
|
1bdc94 |
}
|
|
|
1bdc94 |
|
|
|
1bdc94 |
+void bdrv_enable_dirty_bitmap_locked(BdrvDirtyBitmap *bitmap)
|
|
|
1bdc94 |
+{
|
|
|
1bdc94 |
+ assert(!bdrv_dirty_bitmap_frozen(bitmap));
|
|
|
1bdc94 |
+ bitmap->disabled = false;
|
|
|
1bdc94 |
+}
|
|
|
1bdc94 |
+
|
|
|
1bdc94 |
/* Called with BQL taken. */
|
|
|
1bdc94 |
void bdrv_dirty_bitmap_enable_successor(BdrvDirtyBitmap *bitmap)
|
|
|
1bdc94 |
{
|
|
|
1bdc94 |
@@ -453,8 +459,7 @@ void bdrv_disable_dirty_bitmap(BdrvDirtyBitmap *bitmap)
|
|
|
1bdc94 |
void bdrv_enable_dirty_bitmap(BdrvDirtyBitmap *bitmap)
|
|
|
1bdc94 |
{
|
|
|
1bdc94 |
bdrv_dirty_bitmap_lock(bitmap);
|
|
|
1bdc94 |
- assert(!bdrv_dirty_bitmap_frozen(bitmap));
|
|
|
1bdc94 |
- bitmap->disabled = false;
|
|
|
1bdc94 |
+ bdrv_enable_dirty_bitmap_locked(bitmap);
|
|
|
1bdc94 |
bdrv_dirty_bitmap_unlock(bitmap);
|
|
|
1bdc94 |
}
|
|
|
1bdc94 |
|
|
|
1bdc94 |
diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h
|
|
|
1bdc94 |
index 1e14743..af9ba3c 100644
|
|
|
1bdc94 |
--- a/include/block/dirty-bitmap.h
|
|
|
1bdc94 |
+++ b/include/block/dirty-bitmap.h
|
|
|
1bdc94 |
@@ -33,6 +33,7 @@ void bdrv_remove_persistent_dirty_bitmap(BlockDriverState *bs,
|
|
|
1bdc94 |
Error **errp);
|
|
|
1bdc94 |
void bdrv_disable_dirty_bitmap(BdrvDirtyBitmap *bitmap);
|
|
|
1bdc94 |
void bdrv_enable_dirty_bitmap(BdrvDirtyBitmap *bitmap);
|
|
|
1bdc94 |
+void bdrv_enable_dirty_bitmap_locked(BdrvDirtyBitmap *bitmap);
|
|
|
1bdc94 |
BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs);
|
|
|
1bdc94 |
uint32_t bdrv_get_default_bitmap_granularity(BlockDriverState *bs);
|
|
|
1bdc94 |
uint32_t bdrv_dirty_bitmap_granularity(const BdrvDirtyBitmap *bitmap);
|
|
|
1bdc94 |
--
|
|
|
1bdc94 |
1.8.3.1
|
|
|
1bdc94 |
|