From bd5b7756c33c8eabc7d946468c3cf0c8f1a264bc Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Tue, 5 Sep 2006 17:06:02 +0100 Subject: 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 --- tools/xenmon/xenmon.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools/xenmon') diff --git a/tools/xenmon/xenmon.py b/tools/xenmon/xenmon.py index 1b74d19403..402b6b4e18 100644 --- a/tools/xenmon/xenmon.py +++ b/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: -- cgit v1.2.3