[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 02/19] block: move bdrv_can_store_new_dirty_bitmap to block/dir
From: |
John Snow |
Subject: |
[PULL v3 02/19] block: move bdrv_can_store_new_dirty_bitmap to block/dirty-bitmap.c |
Date: |
Thu, 17 Oct 2019 17:54:19 -0400 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
block/dirty-bitmap.c seems to be more appropriate for it and
bdrv_remove_persistent_dirty_bitmap already in it.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: John Snow <address@hidden>
---
block.c | 22 ----------------------
block/dirty-bitmap.c | 22 ++++++++++++++++++++++
2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/block.c b/block.c
index 1946fc6f57..d19a4781a3 100644
--- a/block.c
+++ b/block.c
@@ -6582,25 +6582,3 @@ void bdrv_del_child(BlockDriverState *parent_bs,
BdrvChild *child, Error **errp)
parent_bs->drv->bdrv_del_child(parent_bs, child, errp);
}
-
-bool bdrv_can_store_new_dirty_bitmap(BlockDriverState *bs, const char *name,
- uint32_t granularity, Error **errp)
-{
- BlockDriver *drv = bs->drv;
-
- if (!drv) {
- error_setg_errno(errp, ENOMEDIUM,
- "Can't store persistent bitmaps to %s",
- bdrv_get_device_or_node_name(bs));
- return false;
- }
-
- if (!drv->bdrv_can_store_new_dirty_bitmap) {
- error_setg_errno(errp, ENOTSUP,
- "Can't store persistent bitmaps to %s",
- bdrv_get_device_or_node_name(bs));
- return false;
- }
-
- return drv->bdrv_can_store_new_dirty_bitmap(bs, name, granularity, errp);
-}
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index 134e0c9a0c..8f42015db9 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -464,6 +464,28 @@ void bdrv_remove_persistent_dirty_bitmap(BlockDriverState
*bs,
}
}
+bool bdrv_can_store_new_dirty_bitmap(BlockDriverState *bs, const char *name,
+ uint32_t granularity, Error **errp)
+{
+ BlockDriver *drv = bs->drv;
+
+ if (!drv) {
+ error_setg_errno(errp, ENOMEDIUM,
+ "Can't store persistent bitmaps to %s",
+ bdrv_get_device_or_node_name(bs));
+ return false;
+ }
+
+ if (!drv->bdrv_can_store_new_dirty_bitmap) {
+ error_setg_errno(errp, ENOTSUP,
+ "Can't store persistent bitmaps to %s",
+ bdrv_get_device_or_node_name(bs));
+ return false;
+ }
+
+ return drv->bdrv_can_store_new_dirty_bitmap(bs, name, granularity, errp);
+}
+
void bdrv_disable_dirty_bitmap(BdrvDirtyBitmap *bitmap)
{
bdrv_dirty_bitmap_lock(bitmap);
--
2.21.0
- [PULL v3 00/19] Bitmaps patches, John Snow, 2019/10/17
- [PULL v3 01/19] util/hbitmap: strict hbitmap_reset, John Snow, 2019/10/17
- [PULL v3 02/19] block: move bdrv_can_store_new_dirty_bitmap to block/dirty-bitmap.c,
John Snow <=
- [PULL v3 03/19] block/dirty-bitmap: return int from bdrv_remove_persistent_dirty_bitmap, John Snow, 2019/10/17
- [PULL v3 04/19] block/qcow2: proper locking on bitmap add/remove paths, John Snow, 2019/10/17
- [PULL v3 05/19] block/dirty-bitmap: drop meta, John Snow, 2019/10/17
- [PULL v3 07/19] block/dirty-bitmap: drop BdrvDirtyBitmap.mutex, John Snow, 2019/10/17
- [PULL v3 06/19] block/dirty-bitmap: add bs link, John Snow, 2019/10/17
- [PULL v3 08/19] block/dirty-bitmap: refactor bdrv_dirty_bitmap_next, John Snow, 2019/10/17
- [PULL v3 10/19] block: reverse order for reopen commits, John Snow, 2019/10/17
- [PULL v3 09/19] block: switch reopen queue from QSIMPLEQ to QTAILQ, John Snow, 2019/10/17
- [PULL v3 12/19] block/qcow2-bitmap: get rid of bdrv_has_changed_persistent_bitmaps, John Snow, 2019/10/17
- [PULL v3 11/19] iotests: add test-case to 165 to test reopening qcow2 bitmaps to RW, John Snow, 2019/10/17