From fefb2d743af38d2199cf01bac59df8c8e44c6683 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 18 Sep 2019 14:48:57 +0200 Subject: [PATCH] qemu: checkpoint: Enforce that 'bitmap' name must match checkpoint name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevent insane configurations by enforcing that disk bitmap for a checkpoint must match the name of the checkpoint. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- 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 4a618f5236..3abbab1514 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -270,6 +270,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 " -- GitLab