From f37d306f6e02a469bd79293f8431df9ca3034744 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 3 Nov 2020 12:49:11 +0100 Subject: [PATCH] virsh: checkpoint-create: Add support for VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- docs/manpages/virsh.rst | 7 ++++++- tools/virsh-checkpoint.c | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 1290a4bca2..bfd26e3120 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -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 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. diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index ac9d5bd348..cc2bbdae8a 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -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;