Some of the pre-snapshot check have restrictions wired in regarding
configuration options that influence taking of external checkpoints.
This patch removes restrictions that would inhibit taking of such a
snapshot.
---
src/qemu/qemu_driver.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5cace0c..3a9f42e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -10585,13 +10585,6 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm,
virDomainSnapshotDefPtr def,
break;
case VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL:
- if (def->state != VIR_DOMAIN_DISK_SNAPSHOT) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("system checkpoint external snapshot for "
- "disk %s not implemented yet"),
- disk->name);
- goto cleanup;
- }
if (!disk->driverType) {
if (!(disk->driverType = strdup("qcow2"))) {
virReportOOMError();
@@ -10634,12 +10627,15 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm,
virDomainSnapshotDefPtr def,
}
}
- if (!found) {
+ /* external snapshot is possible without specifying a disk to snapshot */
+ if (!found &&
+ !(def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("snapshots require at least one disk to be "
- "selected for snapshot"));
+ _("internal and disk-only snapshots require at least "
+ "one disk to be selected for snapshot"));
goto cleanup;
}
+
if (def->state != VIR_DOMAIN_DISK_SNAPSHOT && active) {
if (external == 1 ||
qemuCapsGet(priv->caps, QEMU_CAPS_TRANSACTION)) {
@@ -11255,7 +11251,8 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
snap = other;
}
if (def->dom) {
- if (def->state == VIR_DOMAIN_DISK_SNAPSHOT) {
+ if (def->state == VIR_DOMAIN_DISK_SNAPSHOT ||
+ def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) {
align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
align_match = false;
}
@@ -11285,9 +11282,10 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
} else {
def->state = virDomainObjGetState(vm, NULL);
- def->memory = (def->state == VIR_DOMAIN_SHUTOFF ?
- VIR_DOMAIN_SNAPSHOT_LOCATION_NONE :
- VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL);
+ if (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) {
+ align_match = false;
+ align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
+ }
}
if (virDomainSnapshotAlignDisks(def, align_location,
align_match) < 0 ||
--
1.7.12