aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2017-06-28 15:05:19 +0300
committerMax Reitz <mreitz@redhat.com>2017-07-11 17:44:58 +0200
commit5f72826e7fc62167cf3a37383d1c1151bc9971fe (patch)
tree573f4c28b9f044f6e2511d6cefcf4ec5abee8886 /block/qcow2.c
parent3dd10a06d173e0904c6d47ced1de67c40139d5b1 (diff)
qcow2: add persistent dirty bitmaps support
Store persistent dirty bitmaps in qcow2 image. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20170628120530.31251-20-vsementsov@virtuozzo.com [mreitz: Always assign ret in store_bitmap() in case of an error] Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index 19cc49a85b..790b5b188f 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2046,6 +2046,7 @@ static int qcow2_inactivate(BlockDriverState *bs)
{
BDRVQcow2State *s = bs->opaque;
int ret, result = 0;
+ Error *local_err = NULL;
ret = qcow2_cache_flush(bs, s->l2_table_cache);
if (ret) {
@@ -2061,6 +2062,14 @@ static int qcow2_inactivate(BlockDriverState *bs)
strerror(-ret));
}
+ qcow2_store_persistent_dirty_bitmaps(bs, &local_err);
+ if (local_err != NULL) {
+ result = -EINVAL;
+ error_report_err(local_err);
+ error_report("Persistent bitmaps are lost for node '%s'",
+ bdrv_get_device_or_node_name(bs));
+ }
+
if (result == 0) {
qcow2_mark_clean(bs);
}