aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2015-12-10 12:55:48 +0300
committerKevin Wolf <kwolf@redhat.com>2015-12-18 14:34:43 +0100
commitb1fc8f934ba3fcdc8381b89413ad4df2e90d5312 (patch)
treef6d503f2a2f9621e79b702ab307a7547c2abbf12 /block/qcow2.c
parente9dbdc5e46054c4660b4c4f705ce8ff6aeb4959b (diff)
qcow2: insert assert into qcow2_get_specific_info()
s->qcow_version is always set to 2 or 3. Let's assert if this is wrong. Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Roman Kagan <rkagan@virtuozzo.com> CC: Max Reitz <mreitz@redhat.com> CC: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index 0304de65a7..1789af43d2 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2803,6 +2803,10 @@ static ImageInfoSpecific *qcow2_get_specific_info(BlockDriverState *bs)
.has_corrupt = true,
.refcount_bits = s->refcount_bits,
};
+ } else {
+ /* if this assertion fails, this probably means a new version was
+ * added without having it covered here */
+ assert(false);
}
return spec_info;