debuggers.hg

changeset 20681:7088591b454b

xend: fix empty 'cpus' parsing

/etc/xen/xmexample.hvm says "" means "leave to Xen to pick", but we
get a "Error: string index out of range" currently.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Dec 14 07:59:12 2009 +0000 (2009-12-14)
parents 73ff2d056e36
children e73d666b4d30
files tools/python/xen/xend/XendConfig.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Mon Dec 14 07:58:47 2009 +0000
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Mon Dec 14 07:59:12 2009 +0000
     1.3 @@ -577,6 +577,8 @@ class XendConfig(dict):
     1.4          #    "0-3,^1"   -> [0,2,3]
     1.5          #    "0-3,^1,1" -> [0,1,2,3]
     1.6          l = []
     1.7 +        if s == "":
     1.8 +            return l
     1.9          for c in s.split(','):
    1.10              if c.find('-') != -1:
    1.11                  (x, y) = c.split('-')