[libvirt] [PATCH] qemu: snapshot: Use better check when reverting external snapshots

Martin Kletzander mkletzan at redhat.com
Tue Mar 4 09:31:16 UTC 2014


On Tue, Mar 04, 2014 at 10:15:00AM +0100, Peter Krempa wrote:
> 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.
> ---

ACK,

Martin

>  src/qemu/qemu_driver.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index e04a328..4fbcb27 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,
> --
> 1.9.0
>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140304/0031b19d/attachment-0001.sig>


More information about the libvir-list mailing list