mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
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:
1 parent
b195c30cf4
commit
56be995b8a
1 file changed
+10
-4
@@ -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)
|
||||
|
||||