]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: checkpoint: Don't require <domain> when redefining checkpoints
authorPeter Krempa <pkrempa@redhat.com>
Wed, 2 Dec 2020 13:18:40 +0000 (14:18 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 4 Dec 2020 15:15:03 +0000 (16:15 +0100)
The domain definition stored with a checkpoint isn't used currently
apart from matching disks when creating a new checkpoints.

As some users of the incremental backup API want to provide backups in
offline mode under their control (obviously while compying with our
documentation on how the on-disk state should be handled) and then want
to define the checkpoint for live use, supplying a <domain> sub-element
is overly complex and not actually needed by the code.

Relax the restriction when re-defining a checkpoint so that <domain> is
not necessary and add (alibistic) documentation saying that future
actions may not work if it's missing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
docs/formatcheckpoint.rst
src/conf/checkpoint_conf.c

index f159f2a7a38968f13696375c99f049bcf7b5acd9..ff3f1e8c00c3a51c177045fdb1b6a6fbb845636f 100644 (file)
@@ -1,3 +1,5 @@
+.. role:: since
+
 Checkpoint XML format
 =====================
 
@@ -103,12 +105,16 @@ The top-level ``domaincheckpoint`` element may contain the following elements:
    A readonly representation of the inactive `domain
    configuration <formatdomain.html>`__ at the time the checkpoint was created.
    This element may be omitted for output brevity by supplying the
-   ``VIR_DOMAIN_CHECKPOINT_XML_NO_DOMAIN`` flag, but the resulting XML is no
-   longer viable for use with the ``VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE`` flag
-   of ``virDomainCheckpointCreateXML()``. The domain will have
+   ``VIR_DOMAIN_CHECKPOINT_XML_NO_DOMAIN`` flag. The domain will have
    security-sensitive information omitted unless the flag
    ``VIR_DOMAIN_CHECKPOINT_XML_SECURE`` is provided on a read-write connection.
 
+   ``virDomainCheckpointCreateXML()`` requires that the ``<domain>`` is present
+   when used with ``VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE``.
+   :since:`Since 7.0.0` the ``<domain>`` element can be omitted when redefining
+   a checkpoint, but hypervisors may not support certain operations if it's
+   missing.
+
 Examples
 --------
 
index 665beb3da40932580fe69bbe924b2eec7b829172..7edc7daa12f2f1dd4c5529a4b3016bcd09e9b228 100644 (file)
@@ -165,10 +165,6 @@ virDomainCheckpointDefParse(xmlXPathContextPtr ctxt,
                                                     domainParseFlags);
             if (!def->parent.dom)
                 return NULL;
-        } else {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("missing domain in checkpoint redefine"));
-            return NULL;
         }
     } else if (virDomainXMLOptionRunMomentPostParse(xmlopt, &def->parent) < 0) {
         return NULL;