[PATCH virt-manager 11/14] virt-xml: Add --no-define argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add `--no-define` argument. It's mutually exclusive to the `--define`
argument and later on it allows the user to start a domain
transiently.

Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx>
---
 virt-xml | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/virt-xml b/virt-xml
index 8088715cde7e..0f43d68a5900 100755
--- a/virt-xml
+++ b/virt-xml
@@ -364,9 +364,13 @@ def parse_args():
                "With --add-device, this is a hotplug operation.\n"
                "With --remove-device, this is a hotunplug operation.\n"
                "With --edit, this is an update device operation."))
-    outg.add_argument("--define", action="store_true",
-        help=_("Force defining the domain. Only required if a --print "
-               "option was specified."))
+    define_g = outg.add_mutually_exclusive_group()
+    define_g.add_argument("--define", action="store_true",
+                          help=_("Force defining the domain. Only required if a --print "
+                                 "option was specified."))
+    define_g.add_argument("--no-define", dest='define', action="store_false",
+                          help=_("Force not defining the domain."))
+    define_g.set_defaults(define=None)
     outg.add_argument("--print-diff", action="store_true",
         help=_("Only print the requested change, in diff format"))
     outg.add_argument("--print-xml", action="store_true",
@@ -427,7 +431,8 @@ def main(conn=None):
             if not options.define:
                 options.print_xml = True
         else:
-            options.define = True
+            if options.define is None:
+                options.define = True
     if options.confirm and not options.print_xml:
         options.print_diff = True
 
-- 
2.17.0

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux