qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PULL 35/48] qcow2: insert assert into qcow2_get_specific_i


From: Kevin Wolf
Subject: [Qemu-block] [PULL 35/48] qcow2: insert assert into qcow2_get_specific_info()
Date: Fri, 18 Dec 2015 16:07:41 +0100

From: "Denis V. Lunev" <address@hidden>

s->qcow_version is always set to 2 or 3. Let's assert if this is wrong.

Signed-off-by: Denis V. Lunev <address@hidden>
CC: Roman Kagan <address@hidden>
CC: Max Reitz <address@hidden>
CC: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
 block/qcow2.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/block/qcow2.c b/block/qcow2.c
index 0304de6..1789af4 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;
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]