]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: checkpoint: Allow checkpoint redefine for offline VMs
authorPeter Krempa <pkrempa@redhat.com>
Wed, 1 Apr 2020 12:06:44 +0000 (14:06 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 3 Apr 2020 07:55:59 +0000 (09:55 +0200)
Skip the liveness and capability checks when redefining checkpoints as
we don't need qemu interactions to update the metadata.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_checkpoint.c

index 3a510c9780979ed1ce444b4f3b68ac522ce68d2b..8340addf8160603e11a3a922f44960506d48f2ee 100644 (file)
@@ -647,16 +647,18 @@ qemuCheckpointCreateXML(virDomainPtr domain,
         update_current = false;
     }
 
-    if (!virDomainObjIsActive(vm)) {
-        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                       _("cannot create checkpoint for inactive domain"));
-        return NULL;
-    }
+    if (!redefine) {
+        if (!virDomainObjIsActive(vm)) {
+            virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                           _("cannot create checkpoint for inactive domain"));
+            return NULL;
+        }
 
-    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
-        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                       _("incremental backup is not supported yet"));
-        return NULL;
+        if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) {
+            virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                           _("incremental backup is not supported yet"));
+            return NULL;
+        }
     }
 
     if (!(def = virDomainCheckpointDefParseString(xmlDesc, driver->xmlopt,