From: Denis V. Lunev Date: Thu, 10 Dec 2015 09:55:48 +0000 (+0300) Subject: qcow2: insert assert into qcow2_get_specific_info() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b1fc8f934ba3fcdc8381b89413ad4df2e90d5312;p=qemu.git 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 CC: Roman Kagan CC: Max Reitz CC: Kevin Wolf Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- 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;