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@us.ibm.com>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2005-11-15 17:30:55 +01:00
1 parent b195c30cf4
commit 56be995b8a
1 file changed
+10 -4
+10 -4
View File
@@ -437,12 +437,18 @@ class XendDomainInfo:
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)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.