qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] qcow2: insert assert into qcow2_get_specific_info()
@ 2015-12-10  9:55 Denis V. Lunev
  2015-12-10 15:08 ` Eric Blake
  2015-12-10 15:15 ` Kevin Wolf
  0 siblings, 2 replies; 3+ messages in thread
From: Denis V. Lunev @ 2015-12-10  9:55 UTC (permalink / raw)
  Cc: Kevin Wolf, Denis V. Lunev, Max Reitz, qemu-devel, Roman Kagan

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>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-10 15:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-10  9:55 [Qemu-devel] [PATCH 1/1] qcow2: insert assert into qcow2_get_specific_info() Denis V. Lunev
2015-12-10 15:08 ` Eric Blake
2015-12-10 15:15 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).