s->qcow_version is always set to 2 or 3. Let's assert if this is wrong.
Signed-off-by: Denis V. Lunev <[email protected]>
CC: Roman Kagan <[email protected]>
CC: Max Reitz <[email protected]>
CC: Kevin Wolf <[email protected]>
---
block/qcow2.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index 88f56c8..b285014 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2757,6 +2757,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;
--
2.1.4