[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 08/24] block: introduce auto-loading bitmaps
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[Qemu-block] [PATCH 08/24] block: introduce auto-loading bitmaps |
Date: |
Thu, 2 Feb 2017 16:21:29 +0300 |
Auto loading bitmaps are bitmaps stored in the disk image, which should
be loaded when the image is opened and become BdrvDirtyBitmaps for the
corresponding drive.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
block.c | 14 ++++++++++++++
include/block/block.h | 2 ++
include/block/block_int.h | 3 +++
3 files changed, 19 insertions(+)
diff --git a/block.c b/block.c
index a0346c80c6..56f030c562 100644
--- a/block.c
+++ b/block.c
@@ -1141,6 +1141,13 @@ static int bdrv_open_common(BlockDriverState *bs,
BdrvChild *file,
assert(bdrv_min_mem_align(bs) != 0);
assert(is_power_of_2(bs->bl.request_alignment));
+ bdrv_load_autoloading_dirty_bitmaps(bs, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ ret = -EINVAL;
+ goto free_and_fail;
+ }
+
qemu_opts_del(opts);
return 0;
@@ -4093,3 +4100,10 @@ void bdrv_del_child(BlockDriverState *parent_bs,
BdrvChild *child, Error **errp)
parent_bs->drv->bdrv_del_child(parent_bs, child, errp);
}
+
+void bdrv_load_autoloading_dirty_bitmaps(BlockDriverState *bs, Error **errp)
+{
+ if (bs->drv && bs->drv->bdrv_load_autoloading_dirty_bitmaps) {
+ bs->drv->bdrv_load_autoloading_dirty_bitmaps(bs, errp);
+ }
+}
diff --git a/include/block/block.h b/include/block/block.h
index 4e81f2069b..154ac7f955 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -551,4 +551,6 @@ void bdrv_add_child(BlockDriverState *parent,
BlockDriverState *child,
Error **errp);
void bdrv_del_child(BlockDriverState *parent, BdrvChild *child, Error **errp);
+void bdrv_load_autoloading_dirty_bitmaps(BlockDriverState *bs, Error **errp);
+
#endif
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 2d92d7edfe..6b2b50c6a2 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -320,6 +320,9 @@ struct BlockDriver {
void (*bdrv_del_child)(BlockDriverState *parent, BdrvChild *child,
Error **errp);
+ void (*bdrv_load_autoloading_dirty_bitmaps)(BlockDriverState *bs,
+ Error **errp);
+
QLIST_ENTRY(BlockDriver) list;
};
--
2.11.0
- [Qemu-block] [PATCH 19/24] iotests: test qcow2 persistent dirty bitmap, (continued)
- [Qemu-block] [PATCH 19/24] iotests: test qcow2 persistent dirty bitmap, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 16/24] qmp: add persistent flag to block-dirty-bitmap-add, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 12/24] block/dirty-bitmap: add bdrv_dirty_bitmap_next(), Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 21/24] qcow2-bitmap: refcounts, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 22/24] block/dirty-bitmap: add bdrv_remove_persistent_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 20/24] qcow2-refcount: rename inc_refcounts() and make it public, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 03/24] hbitmap: improve dirty iter, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 24/24] qmp: block-dirty-bitmap-remove: remove persistent, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 23/24] qcow2: add .bdrv_remove_persistent_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 07/24] qcow2: add bitmaps extension, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 08/24] block: introduce auto-loading bitmaps,
Vladimir Sementsov-Ogievskiy <=
- [Qemu-block] [PATCH 06/24] block/dirty-bitmap: add deserialize_ones func, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 05/24] block: fix bdrv_dirty_bitmap_granularity signature, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 11/24] block: introduce persistent dirty bitmaps, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 15/24] qcow2: add .bdrv_can_store_new_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 04/24] tests: add hbitmap iter test, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 13/24] qcow2: add .bdrv_store_persistent_dirty_bitmaps(), Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 17/24] qmp: add autoload parameter to block-dirty-bitmap-add, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 18/24] qmp: add x-debug-block-dirty-bitmap-sha256, Vladimir Sementsov-Ogievskiy, 2017/02/02
- [Qemu-block] [PATCH 09/24] qcow2: add .bdrv_load_autoloading_dirty_bitmaps, Vladimir Sementsov-Ogievskiy, 2017/02/02
- Re: [Qemu-block] [Qemu-devel] [PATCH v12 00/24] qcow2: persistent dirty bitmaps, no-reply, 2017/02/02