From: Peter Krempa Date: Thu, 20 Jun 2019 12:44:51 +0000 (+0200) Subject: virsh: snapshot: Don't block --no-metadata with --print-xml X-Git-Tag: v5.5.0-rc1~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68e1a05fa4d24fbe398578a042cd4a955f17c673;p=thirdparty%2Flibvirt.git virsh: snapshot: Don't block --no-metadata with --print-xml When testing stuff you might want to print the XML. Interlocking it with no metadata adds exactly 0 value to the user. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index f6bb38bc96..e9f0ee0810 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -369,14 +369,8 @@ cmdSnapshotCreateAs(vshControl *ctl, const vshCmd *cmd) unsigned int flags = 0; const vshCmdOpt *opt = NULL; - if (vshCommandOptBool(cmd, "no-metadata")) { - if (vshCommandOptBool(cmd, "print-xml")) { - vshError(ctl, "%s", - _("--print-xml is incompatible with --no-metadata")); - return false; - } + if (vshCommandOptBool(cmd, "no-metadata")) flags |= VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA; - } if (vshCommandOptBool(cmd, "halt")) flags |= VIR_DOMAIN_SNAPSHOT_CREATE_HALT; if (vshCommandOptBool(cmd, "disk-only")) diff --git a/tools/virsh.pod b/tools/virsh.pod index 2e70b68a66..dc39004a66 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -4653,7 +4653,7 @@ metadata is silently lost when the domain quits running (whether by command such as B or by internal guest action). =item B I {[I<--print-xml>] -| [I<--no-metadata>] [I<--halt>] [I<--reuse-external>]} [I] +[I<--no-metadata>] [I<--halt>] [I<--reuse-external>]} [I] [I] [I<--disk-only> [I<--quiesce>]] [I<--atomic>] [[I<--live>] [I<--memspec> B]] [I<--diskspec>] B]... @@ -4703,7 +4703,7 @@ If I<--no-metadata> is specified, then the snapshot data is created, but any metadata is immediately discarded (that is, libvirt does not treat the snapshot as current, and cannot revert to the snapshot unless B is later used to teach libvirt about the -metadata again). This flag is incompatible with I<--print-xml>. +metadata again). If I<--atomic> is specified, libvirt will guarantee that the snapshot either succeeds, or fails with no changes; not all hypervisors support