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

[Xen-devel] [PATCH] xenmon: --ms_per_sample: check a negative value



Hi,

This patch adds the argument check of "--ms_per_sample=" option. For
"--ms_per_sample=", a negative value should be invalid.

e.g.
  % xenmon.py -n --ms_per_sample=-1
  usage: xenmon.py [options]
  
  xenmon.py: error: option --ms_per_sample: invalid negative value: '-1'

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
-- 
  KUWAMURA Shin'ya
diff -r 3d36f020e62a tools/xenmon/xenmon.py
--- a/tools/xenmon/xenmon.py    Mon Sep 04 13:54:36 2006 -0700
+++ b/tools/xenmon/xenmon.py    Fri Sep 01 13:33:17 2006 +0900
@@ -672,6 +672,9 @@ def main():
 
     parser = setup_cmdline_parser()
     (options, args) = parser.parse_args()
+    if options.mspersample < 0:
+        parser.error("option --ms_per_sample: invalid negative value: '%d'" %
+                     options.mspersample)
     
     start_xenbaked()
     if options.live:
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.