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 fixes dom0 SMP vcpu hotplug. Currently, doma

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] This patch fixes dom0 SMP vcpu hotplug. Currently, domains without
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Nov 2005 21:16:18 +0000
Delivery-date: Tue, 15 Nov 2005 21:18:24 +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 emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 2acbe70dd418a963fc15d6b3f5bd0ecf76881f50
# Parent  fcf13f653dbaed0962e5e2aa1e9ac9439e704358
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.

Signed-off-by: Ryan Harper <ryanh@xxxxxxxxxx>

diff -r fcf13f653dba -r 2acbe70dd418 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Tue Nov 15 16:28:05 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Tue Nov 15 16:30:55 2005
@@ -437,12 +437,18 @@
             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('memory',       lambda: 0)

_______________________________________________
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 fixes dom0 SMP vcpu hotplug. Currently, domains without, Xen patchbot -unstable <=