]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: snapshot: Don't block --no-metadata with --print-xml
authorPeter Krempa <pkrempa@redhat.com>
Thu, 20 Jun 2019 12:44:51 +0000 (14:44 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 20 Jun 2019 14:09:59 +0000 (16:09 +0200)
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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tools/virsh-snapshot.c
tools/virsh.pod

index f6bb38bc96ce845a07b007304e6d5d3838e3b779..e9f0ee0810d3bdd06f339f5476e013568687ee93 100644 (file)
@@ -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"))
index 2e70b68a661a8033982afdd7c2b40c22e1ead303..dc39004a6698ca05adf71d038d41d6f1ac5fdf21 100644 (file)
@@ -4653,7 +4653,7 @@ metadata is silently lost when the domain quits running (whether
 by command such as B<destroy> or by internal guest action).
 
 =item B<snapshot-create-as> I<domain> {[I<--print-xml>]
-[I<--no-metadata>] [I<--halt>] [I<--reuse-external>]} [I<name>]
+[I<--no-metadata>] [I<--halt>] [I<--reuse-external>]} [I<name>]
 [I<description>] [I<--disk-only> [I<--quiesce>]] [I<--atomic>]
 [[I<--live>] [I<--memspec> B<memspec>]] [I<--diskspec>] B<diskspec>]...
 
@@ -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<snapshot-create> 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