Skip to contentSkip to conversation

Fix argument check of xm reboot command (2)

PATCH New Masaki Kanno 1 participant 1 message Jun 29, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix argument check of xm reboot command (2)

Hi,

When two or more domain parameters are given, the xm reboot command doesn't give a command error. This problem is also included in the xm shutdown command.

This patch checks on domain parameter. If two or more domain parameters are given, the command error occurs.

Best regards,
Kan

tools/python/xen/xm/shutdown.py +2 -1
diff -r 4b51d081378d tools/python/xen/xm/shutdown.py
@@ -92,7 +92,8 @@ def main_all(opts, args):
     shutdown(opts, None, mode, opts.vals.wait)
 
 def main_dom(opts, args):
-    if len(args) < 1: opts.err('Missing domain')
+    if len(args) == 0: opts.err('No domain parameter given')
+    if len(args) >  1: opts.err('No multiple domain parameters allowed')
     dom = args[0]
     mode = shutdown_mode(opts)  
     shutdown(opts, [ dom ], mode, opts.vals.wait)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel