From: Peter Krempa Date: Tue, 4 Mar 2014 09:06:22 +0000 (+0100) Subject: qemu: snapshot: Use better check when reverting external snapshots X-Git-Tag: v1.2.3-rc1~358 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d410e6f19d944ad78bc9257726d613597db00701;p=thirdparty%2Flibvirt.git qemu: snapshot: Use better check when reverting external snapshots https://bugzilla.redhat.com/show_bug.cgi?id=1071264 Reverting of external snapshots is not supported currently. The check that is present doesn't properly check for all aspects that make a snapshot external. Use virDomainSnapshotIsExternal() to do the check. --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e04a328418..4fbcb27b75 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13921,12 +13921,13 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, "to revert to inactive snapshot")); goto cleanup; } - if (snap->def->state == VIR_DOMAIN_DISK_SNAPSHOT) { + + if (virDomainSnapshotIsExternal(snap)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("revert to external disk snapshot not supported " - "yet")); + _("revert to external snapshot not supported yet")); goto cleanup; } + if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)) { if (!snap->def->dom) { virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY,