]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuCheckpointDiscardBitmaps: Refuse to delete checkpoint with NULL bitmap name
authorPeter Krempa <pkrempa@redhat.com>
Mon, 22 Mar 2021 13:43:17 +0000 (14:43 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 23 Mar 2021 13:06:31 +0000 (14:06 +0100)
When a checkpoint is redefined without providing the domain XML, we
might end up with a definition where the per-disk bitmap name is not
set. Trying to delete such checkpoint would lead to a crash.

Refuse such deletion.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1941600
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_checkpoint.c

index 689a556959f76b267a6321d809346c0d08fc5c92..d2a621a52bb51ecf5da70f4ac7fd68e14f4aa3eb 100644 (file)
@@ -206,6 +206,13 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm,
         if (chkdisk->type != VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP)
             continue;
 
+        if (!chkdisk->bitmap) {
+            virReportError(VIR_ERR_INVALID_ARG,
+                           _("missing bitmap name for disk '%s' of checkpoint '%s'"),
+                           chkdisk->name, chkdef->parent.name);
+            return -1;
+        }
+
         if (qemuCheckpointDiscardDiskBitmaps(domdisk->src, blockNamedNodeData,
                                              chkdisk->bitmap,
                                              actions, domdisk->dst,