ia64/xen-unstable

changeset 15610:ee7a5ddc1847

Improve xm uptime command for inactive managed domains
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author kfraser@localhost.localdomain
date Tue Jul 17 10:36:33 2007 +0100 (2007-07-17)
parents c1deef05c354
children 45b97e0f2dc8
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Tue Jul 17 10:33:26 2007 +0100
     1.2 +++ b/tools/python/xen/xm/main.py	Tue Jul 17 10:36:33 2007 +0100
     1.3 @@ -1729,14 +1729,16 @@ def xm_uptime(args):
     1.4          if k in ['-s', '--short']:
     1.5              short_mode = 1
     1.6  
     1.7 -    doms = getDomains(params, 'running')
     1.8 +    doms = getDomains(params, 'all')
     1.9  
    1.10      if short_mode == 0:
    1.11          print '%-33s %4s %s ' % ('Name','ID','Uptime')
    1.12  
    1.13      for dom in doms:
    1.14          d = parse_doms_info(dom)
    1.15 -        if int(d['domid']) > 0:
    1.16 +        if d['domid'] == '':
    1.17 +            uptime = 0
    1.18 +        elif int(d['domid']) > 0:
    1.19              uptime = int(round(d['up_time']))
    1.20          else:
    1.21              f=open('/proc/uptime', 'r')