[libvirt] [PATCH 3/4] qemu: snapshot: Don't forbid snapshot if autodestroy is registered

Peter Krempa posted 4 patches 6 years, 4 months ago
[libvirt] [PATCH 3/4] qemu: snapshot: Don't forbid snapshot if autodestroy is registered
Posted by Peter Krempa 6 years, 4 months ago
Semantically VIR_DOMAIN_START_AUTODESTROY doesn't really clash with
snapshot operations as the VM stays on the same host and thus bound to
the same connection. Saving the state also doesn't differ from modifying
the state of the VM which is allowed.

Remove the check as it doesn't make much sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_driver.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index f7f059b6d6..823aa558ac 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15917,12 +15917,6 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
     if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
         goto cleanup;

-    if (qemuProcessAutoDestroyActive(driver, vm)) {
-        virReportError(VIR_ERR_OPERATION_INVALID,
-                       "%s", _("domain is marked for auto destroy"));
-        goto cleanup;
-    }
-
     if (!vm->persistent && (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT)) {
         virReportError(VIR_ERR_OPERATION_INVALID, "%s",
                        _("cannot halt after transient domain snapshot"));
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 3/4] qemu: snapshot: Don't forbid snapshot if autodestroy is registered
Posted by Eric Blake 6 years, 4 months ago
On 9/24/19 8:17 AM, Peter Krempa wrote:
> Semantically VIR_DOMAIN_START_AUTODESTROY doesn't really clash with
> snapshot operations as the VM stays on the same host and thus bound to
> the same connection. Saving the state also doesn't differ from modifying
> the state of the VM which is allowed.
> 
> Remove the check as it doesn't make much sense.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/qemu/qemu_driver.c | 6 ------
>  1 file changed, 6 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index f7f059b6d6..823aa558ac 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -15917,12 +15917,6 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
>      if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
>          goto cleanup;
> 
> -    if (qemuProcessAutoDestroyActive(driver, vm)) {
> -        virReportError(VIR_ERR_OPERATION_INVALID,
> -                       "%s", _("domain is marked for auto destroy"));
> -        goto cleanup;
> -    }
> -
>      if (!vm->persistent && (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT)) {
>          virReportError(VIR_ERR_OPERATION_INVALID, "%s",
>                         _("cannot halt after transient domain snapshot"));
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list