aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2-refcount.c
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2017-06-28 15:05:08 +0300
committerMax Reitz <mreitz@redhat.com>2017-07-11 17:44:57 +0200
commit88ddffae8fc1e30cc907c2dbb989b7eba9e62319 (patch)
tree312f7ceab9b279ca0d04c7ad31d9f8b25c74e058 /block/qcow2-refcount.c
parent8a5bb1f114c5959cf6b247a737394afb0c518b40 (diff)
downloadqemu-88ddffae8fc1e30cc907c2dbb989b7eba9e62319.zip
qemu-88ddffae8fc1e30cc907c2dbb989b7eba9e62319.tar.gz
qemu-88ddffae8fc1e30cc907c2dbb989b7eba9e62319.tar.bz2
qcow2: add bitmaps extension
Add bitmap extension as specified in docs/specs/qcow2.txt. For now, just mirror extension header into Qcow2 state and check constraints. Also, calculate refcounts for qcow2 bitmaps, to not break qemu-img check. For now, disable image resize if it has bitmaps. It will be fixed later. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-9-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/qcow2-refcount.c')
-rw-r--r--block/qcow2-refcount.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 8add3d5..ceb08bc 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -1869,6 +1869,12 @@ static int calculate_refcounts(BlockDriverState *bs, BdrvCheckResult *res,
}
}
+ /* bitmaps */
+ ret = qcow2_check_bitmaps_refcounts(bs, res, refcount_table, nb_clusters);
+ if (ret < 0) {
+ return ret;
+ }
+
return check_refblocks(bs, res, fix, rebuild, refcount_table, nb_clusters);
}