Skip to contentSkip to conversation

xenmon: --ms_per_sample: check a negative value

PATCH Applied KUWAMURA Shin'ya 2 participants 2 messages Sep 5, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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'

Signature · 1 line
  KUWAMURA Shin'ya
tools/xenmon/xenmon.py +3 -0
diff -r 3d36f020e62a tools/xenmon/xenmon.py
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

Applied
#1 lore raw
Quoted 5 lines · KUWAMURA Shin'ya

Hi,

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

Quoted 7 lines

e.g.
% xenmon.py -n --ms_per_sample=-1
usage: xenmon.py [options]

xenmon.py: error: option --ms_per_sample: invalid negative value: '-1'

Applied, thanks.

Ewan.