direct-io.hg

changeset 13807:2379569b590d

Fix xm sched-credit when given an invalid domain name.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Feb 06 16:05:29 2007 +0000 (2007-02-06)
parents 39a2833dde51
children 3093bd26ae45 978ff6fad81f
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Tue Feb 06 15:37:11 2007 +0000
     1.2 +++ b/tools/python/xen/xm/main.py	Tue Feb 06 16:05:29 2007 +0000
     1.3 @@ -1144,6 +1144,9 @@ def xm_sched_sedf(args):
     1.4      doms = filter(lambda x : domid_match(domid, x),
     1.5                          [parse_doms_info(dom)
     1.6                           for dom in getDomains(None, 'running')])
     1.7 +    if domid is not None and doms == []: 
     1.8 +        err("Domain '%s' does not exist." % domid)
     1.9 +        usage('sched-sedf')
    1.10  
    1.11      # print header if we aren't setting any parameters
    1.12      if len(opts.keys()) == 0:
    1.13 @@ -1207,6 +1210,9 @@ def xm_sched_credit(args):
    1.14                    for dom in getDomains(None, 'running')])
    1.15  
    1.16      if weight is None and cap is None:
    1.17 +        if domid is not None and doms == []: 
    1.18 +            err("Domain '%s' does not exist." % domid)
    1.19 +            usage('sched-credit')
    1.20          # print header if we aren't setting any parameters
    1.21          print '%-33s %-2s %-6s %-4s' % ('Name','ID','Weight','Cap')
    1.22