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] xm: Fix string index out of range in 'vcpu-pin' comm

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xm: Fix string index out of range in 'vcpu-pin' command
From: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>
Date: Fri, 09 Apr 2010 11:30:02 +0800
Delivery-date: Thu, 08 Apr 2010 20:29:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 3.0a1 (Windows/2008050715)
Hi,

 This patch fix the following trivial bug.

# xm vcpu-pin 0 0 1,,2
Unexpected error: exceptions.IndexError

Please report to xen-devel@xxxxxxxxxxxxxxxxxxx
Traceback (most recent call last):
  File "/usr/sbin/xm", line 7, in ?
    main.main(sys.argv)
  File "usr/lib/python2.4/site-packages/xen/xm/main.py", line 3616, in main
  File "usr/lib/python2.4/site-packages/xen/xm/main.py", line 3640, in _run_cmd
  File "usr/lib/python2.4/site-packages/xen/xm/main.py", line 1479, in 
xm_vcpu_pin
  File "usr/lib/python2.4/site-packages/xen/xm/main.py", line 1467, in 
cpu_make_map
IndexError: string index out of range


------------------------------------------------

# HG changeset patch
# User Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>
# Date 1270783370 -28800
# Node ID 3c5685e957d1dae49988e401d988e7400319773d
# Parent  3376c90960e83d9f1e34d51601a930290a128c09
xm: Fix string index out of range in 'vcpu-pin' command

if <PCPUs> contins '' (e.g. '1,,2'), error 'string index out of range'
occurs. Fix this trivial bug.

Signed-off-by: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>

diff -r 3376c90960e8 -r 3c5685e957d1 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Wed Apr 07 10:17:27 2010 +0100
+++ b/tools/python/xen/xm/main.py       Fri Apr 09 11:22:50 2010 +0800
@@ -1458,6 +1458,8 @@
     def cpu_make_map(cpulist):
         cpus = []
         for c in cpulist.split(','):
+            if c == '':
+                continue
             if c.find('-') != -1:
                 (x,y) = c.split('-')
                 for i in range(int(x),int(y)+1):



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xm: Fix string index out of range in 'vcpu-pin' command, Yu Zhiguo <=