WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xenmon: --ms_per_sample: check a negative value
From: "KUWAMURA Shin'ya" <kuwa@xxxxxxxxxxxxxx>
Date: Tue, 05 Sep 2006 13:50:15 +0900 (JST)
Delivery-date: Mon, 04 Sep 2006 21:53:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>