Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- 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 40b7dce093..6fc17e38cd 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -7141,7 +7141,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 @@ -7159,6 +7159,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; -- 2.26.2