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-changelog

[Xen-changelog] This patch updates the CPU field in xm list for multi-vc

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] This patch updates the CPU field in xm list for multi-vcpu domains.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 29 Jul 2005 06:36:13 -0400
Delivery-date: Fri, 29 Jul 2005 10:36:56 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 04d01b8fa2194d10b31d77ea5543c247a005db90
# Parent  555b315b482d312dea73061af5720fa1bd14d5b5
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@xxxxxxxxxx>

diff -r 555b315b482d -r 04d01b8fa219 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Fri Jul 29 10:24:41 2005
+++ b/tools/python/xen/xm/main.py       Fri Jul 29 10:27:12 2005
@@ -397,7 +397,7 @@
             d['dom'] = int(sxp.child_value(info, 'id', '-1'))
             d['name'] = sxp.child_value(info, 'name', '??')
             d['mem'] = int(sxp.child_value(info, 'memory', '0'))
-            d['cpu'] = int(sxp.child_value(info, 'cpu', '0'))
+            d['cpu'] = str(sxp.child_value(info, 'cpu', '0'))
             d['vcpus'] = int(sxp.child_value(info, 'vcpus', '0'))
             d['state'] = sxp.child_value(info, 'state', '??')
             d['cpu_time'] = float(sxp.child_value(info, 'cpu_time', '0'))
@@ -406,12 +406,14 @@
                 d['port'] = sxp.child_value(console, 'console_port')
             else:
                 d['port'] = ''
+            if d['vcpus'] > 1:
+                d['cpu'] = '-'
             if ((int(sxp.child_value(info, 'ssidref', '0'))) != 0):
                 d['ssidref1'] =  int(sxp.child_value(info, 'ssidref', '0')) & 
0xffff
                 d['ssidref2'] = (int(sxp.child_value(info, 'ssidref', '0')) >> 
16) & 0xffff
-                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)
+                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)
             else:
-                print ("%(name)-16s %(dom)3d  %(mem)7d  %(cpu)3d  %(vcpus)5d   
%(state)5s  %(cpu_time)7.1f     %(port)4s" % d)
+                print ("%(name)-16s %(dom)3d  %(mem)7d  %(cpu)3s  %(vcpus)5d   
%(state)5s  %(cpu_time)7.1f     %(port)4s" % d)
 
     def show_vcpus(self, doms):
         print 'Name              Id  VCPU  CPU  CPUMAP'

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] This patch updates the CPU field in xm list for multi-vcpu domains., Xen patchbot -unstable <=