Re: [PATCH 1/2] qemuCheckpointDelete: Check VM liveness first

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/26/20 9:54 AM, Peter Krempa wrote:
Move the liveness check prior to the capability check. If the VM is
offline the capabilities are not initialized and thus we'd report the
wrong error.

https://bugzilla.redhat.com/show_bug.cgi?id=1812531

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
  src/qemu/qemu_checkpoint.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Eric Blake <eblake@xxxxxxxxxx>


diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c
index 76f10a701e..62b6e87b53 100644
--- a/src/qemu/qemu_checkpoint.c
+++ b/src/qemu/qemu_checkpoint.c
@@ -771,15 +771,15 @@ qemuCheckpointDelete(virDomainObjPtr vm,
          return -1;

      if (!metadata_only) {
-        if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
+        if (!virDomainObjIsActive(vm)) {
              virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                           _("incremental backup is not supported yet"));
+                           _("cannot delete checkpoint for inactive domain"));
              goto endjob;
          }

-        if (!virDomainObjIsActive(vm)) {
+        if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
              virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                           _("cannot delete checkpoint for inactive domain"));
+                           _("incremental backup is not supported yet"));
              goto endjob;
          }
      }


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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux