diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/qcow2.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index 2ec399663e..bae5893327 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2036,6 +2036,14 @@ static int qcow2_inactivate(BlockDriverState *bs) int ret, result = 0; Error *local_err = NULL; + 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)); + } + ret = qcow2_cache_flush(bs, s->l2_table_cache); if (ret) { result = ret; @@ -2050,14 +2058,6 @@ 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); } |