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

[Xen-devel] [PATCH 2/2] xend: fix vcpu related items

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 2/2] xend: fix vcpu related items
From: Ryan Harper <ryanh@xxxxxxxxxx>
Date: Fri, 4 Nov 2005 16:41:41 -0600
Delivery-date: Fri, 04 Nov 2005 22:41:56 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
This patch fixes dom0 SMP vcpu hotplug.  Currently, domains without
config files (e.g. dom0) don't set info['vcpus'] correctly resulting in
incorrect cpu availablity values in the store.  This prevents hotplug
from functioning.

-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253
ryanh@xxxxxxxxxx


diffstat output:
 XendDomainInfo.py |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

Signed-off-by: Ryan Harper <ryanh@xxxxxxxxxx>
---
diff -r 46f4f1eb70ca tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Nov  4 21:27:11 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Nov  4 16:13:22 2005
@@ -425,13 +425,20 @@
             defaultInfo('on_crash',     lambda: "restart")
             defaultInfo('cpu',          lambda: None)
             defaultInfo('cpu_weight',   lambda: 1.0)
-            defaultInfo('vcpus',        lambda: int(1))
+
+            # some domains don't have a config file (e.g. dom0 )
+            # to set number of vcpus so we derive available cpus
+            # from max_vcpu_id which is present for running domains.
+            if not self.infoIsSet('vcpus') and self.infoIsSet('max_vcpu_id'):
+                avail = int(self.info['max_vcpu_id'])+1
+            else:
+                avail = int(1)
+
+            defaultInfo('vcpus',        lambda: avail)
             defaultInfo('online_vcpus', lambda: self.info['vcpus'])
-
-            self.info['vcpus'] = int(self.info['vcpus'])
             defaultInfo('max_vcpu_id',  lambda: self.info['vcpus']-1)
-
             defaultInfo('vcpu_avail',   lambda: (1 << self.info['vcpus']) - 1)
+
             defaultInfo('bootloader',   lambda: None)
             defaultInfo('backend',      lambda: [])
             defaultInfo('device',       lambda: [])

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 2/2] xend: fix vcpu related items, Ryan Harper <=