[PATCH RFC 22/40] qemu: checkpoint: Enforce that 'bitmap' name must match checkpoint name

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

 



Prevent insane configurations by enforcing that disk bitmap for a
checkpoint must match the name of the checkpoint.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_checkpoint.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c
index a225f04831..54719e7f5c 100644
--- a/src/qemu/qemu_checkpoint.c
+++ b/src/qemu/qemu_checkpoint.c
@@ -271,6 +271,13 @@ qemuCheckpointPrepare(virQEMUDriverPtr driver,
         if (disk->type != VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP)
             continue;

+        if (STRNEQ(disk->bitmap, def->parent.name)) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("bitmap for disk '%s' must match checkpoint name '%s'"),
+                           disk->name, def->parent.name);
+            goto cleanup;
+        }
+
         if (vm->def->disks[i]->src->format != VIR_STORAGE_FILE_QCOW2) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                            _("checkpoint for disk %s unsupported "
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux