]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: checkpoint-create: Add support for VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE
authorPeter Krempa <pkrempa@redhat.com>
Tue, 3 Nov 2020 11:49:11 +0000 (12:49 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 9 Nov 2020 11:25:50 +0000 (12:25 +0100)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
docs/manpages/virsh.rst
tools/virsh-checkpoint.c

index 1290a4bca2c09bd8bacbb802f738499f4898dee7..bfd26e31202c13a2f5ce9105dc657f0a7f019cce 100644 (file)
@@ -7143,7 +7143,7 @@ checkpoint-create
 
 ::
 
-   checkpoint-create domain [xmlfile] { --redefine | [--quiesce]}
+   checkpoint-create domain [xmlfile] { --redefine [--redefine-validate] | [--quiesce]}
 
 Create a checkpoint for domain *domain* with the properties specified
 in *xmlfile* describing a <domaincheckpoint> top-level element. The
@@ -7161,6 +7161,11 @@ alterations in the checkpoint metadata (such as host-specific aspects
 of the domain XML embedded in the checkpoint).  When this flag is
 supplied, the *xmlfile* argument is mandatory.
 
+If *--redefine-validate* is specified along with *--redefine* the hypervisor
+performs validation of metadata associated with the checkpoint stored in places
+besides the checkpoint XML. Note that some hypervisors may require that the
+domain is running to perform validation.
+
 If *--quiesce* is specified, libvirt will try to use guest agent
 to freeze and unfreeze domain's mounted file systems. However,
 if domain has no guest agent, checkpoint creation will fail.
index ac9d5bd3489f961f21297954c1549ce82c048189..cc2bbdae8a722f47f290afb1165f48719c61ba95 100644 (file)
@@ -99,6 +99,10 @@ static const vshCmdOptDef opts_checkpoint_create[] = {
      .type = VSH_OT_BOOL,
      .help = N_("redefine metadata for existing checkpoint")
     },
+    {.name = "redefine-validate",
+     .type = VSH_OT_BOOL,
+     .help = N_("validate the redefined checkpoint")
+    },
     {.name = "quiesce",
      .type = VSH_OT_BOOL,
      .help = N_("quiesce guest's file systems")
@@ -116,8 +120,12 @@ cmdCheckpointCreate(vshControl *ctl,
     char *buffer = NULL;
     unsigned int flags = 0;
 
+    VSH_REQUIRE_OPTION("redefine-validate", "redefine");
+
     if (vshCommandOptBool(cmd, "redefine"))
         flags |= VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE;
+    if (vshCommandOptBool(cmd, "redefine-validate"))
+        flags |= VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE;
     if (vshCommandOptBool(cmd, "quiesce"))
         flags |= VIR_DOMAIN_CHECKPOINT_CREATE_QUIESCE;