ia64/xen-unstable

changeset 5928:04d01b8fa219

This patch updates the CPU field in xm list for multi-vcpu domains.
When a dom runs on multiple physical cpus, the CPU field doesn't have
much meaning. The suggested fix was to replace the value with '-'.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Jul 29 10:27:12 2005 +0000 (2005-07-29)
parents 555b315b482d
children 51094fae410e
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Fri Jul 29 10:24:41 2005 +0000
     1.2 +++ b/tools/python/xen/xm/main.py	Fri Jul 29 10:27:12 2005 +0000
     1.3 @@ -397,7 +397,7 @@ class ProgList(Prog):
     1.4              d['dom'] = int(sxp.child_value(info, 'id', '-1'))
     1.5              d['name'] = sxp.child_value(info, 'name', '??')
     1.6              d['mem'] = int(sxp.child_value(info, 'memory', '0'))
     1.7 -            d['cpu'] = int(sxp.child_value(info, 'cpu', '0'))
     1.8 +            d['cpu'] = str(sxp.child_value(info, 'cpu', '0'))
     1.9              d['vcpus'] = int(sxp.child_value(info, 'vcpus', '0'))
    1.10              d['state'] = sxp.child_value(info, 'state', '??')
    1.11              d['cpu_time'] = float(sxp.child_value(info, 'cpu_time', '0'))
    1.12 @@ -406,12 +406,14 @@ class ProgList(Prog):
    1.13                  d['port'] = sxp.child_value(console, 'console_port')
    1.14              else:
    1.15                  d['port'] = ''
    1.16 +            if d['vcpus'] > 1:
    1.17 +                d['cpu'] = '-'
    1.18              if ((int(sxp.child_value(info, 'ssidref', '0'))) != 0):
    1.19                  d['ssidref1'] =  int(sxp.child_value(info, 'ssidref', '0')) & 0xffff
    1.20                  d['ssidref2'] = (int(sxp.child_value(info, 'ssidref', '0')) >> 16) & 0xffff
    1.21 -                print ("%(name)-16s %(dom)3d  %(mem)7d  %(cpu)3d  %(vcpus)5d   %(state)5s  %(cpu_time)7.1f     %(port)4s    s:%(ssidref2)02x/p:%(ssidref1)02x" % d)
    1.22 +                print ("%(name)-16s %(dom)3d  %(mem)7d  %(cpu)3s  %(vcpus)5d   %(state)5s  %(cpu_time)7.1f     %(port)4s    s:%(ssidref2)02x/p:%(ssidref1)02x" % d)
    1.23              else:
    1.24 -                print ("%(name)-16s %(dom)3d  %(mem)7d  %(cpu)3d  %(vcpus)5d   %(state)5s  %(cpu_time)7.1f     %(port)4s" % d)
    1.25 +                print ("%(name)-16s %(dom)3d  %(mem)7d  %(cpu)3s  %(vcpus)5d   %(state)5s  %(cpu_time)7.1f     %(port)4s" % d)
    1.26  
    1.27      def show_vcpus(self, doms):
    1.28          print 'Name              Id  VCPU  CPU  CPUMAP'