mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
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 <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
1 parent
2e19e68093
commit
69e066c0ba
1 file changed
+2
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user