From: Peter Krempa Date: Mon, 9 Jun 2025 13:50:42 +0000 (+0200) Subject: qemu: snapshot: Allow snapshot consisting only of 'manual'-y handled disks X-Git-Tag: v11.9.0-rc1~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69e066c0ba972f4bdac8a5f5512ebaec3907ff5b;p=thirdparty%2Flibvirt.git qemu: snapshot: Allow snapshot consisting only of 'manual'-y handled disks The 'manual' snapshot mode is meant for disks where the users wants to take a snapshot via means outside of libvirt, e.g. on a SAN network. Allow creating a snapshot which consists entirely of 'manual' disks. For now this effectively means that the VM will be paused but in the future more logic can be added to ensure consistency. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 5c12dca892..d4994dd54e 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -996,7 +996,7 @@ qemuSnapshotPrepare(virDomainObj *vm, } } - if (!found_internal && !external && + if (!found_internal && !external && !*has_manual && def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_NO) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("nothing selected for snapshot")); @@ -1013,7 +1013,7 @@ qemuSnapshotPrepare(virDomainObj *vm, } /* disk snapshot requires at least one disk */ - if (def->state == VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT && !external) { + if (def->state == VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT && !external && !*has_manual) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("disk-only snapshots require at least one disk to be selected for snapshot")); return -1;