]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qcow2: insert assert into qcow2_get_specific_info()
authorDenis V. Lunev <den@openvz.org>
Thu, 10 Dec 2015 09:55:48 +0000 (12:55 +0300)
committerKevin Wolf <kwolf@redhat.com>
Fri, 18 Dec 2015 13:34:43 +0000 (14:34 +0100)
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>
block/qcow2.c

index 0304de65a7743359bda4e52eda72d0c9fe01285a..1789af43d23c680cd3a7825bd45a2b636bdc4a7f 100644 (file)
@@ -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;