Ryan Harper
2005-Nov-08 23:22 UTC
[Xen-devel] [PATCH 2/2][RESEND] xend: fix vcpu related items
Resending, rediffed against changeset: 7701:abbe3df33774 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@us.ibm.com diffstat output: XendDomainInfo.py | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) Signed-off-by: Ryan Harper <ryanh@us.ibm.com> --- # HG changeset patch # User rharper@localhost.localdomain # Node ID 7c7da438dee9c9c23ae798837cf72f4ea2cdb7d4 # Parent 8780650bc95865aeea69f89511ce9b1be9dad82c fix dom0 vcpu related items. diff -r 8780650bc958 -r 7c7da438dee9 tools/python/xen/xend/XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py Tue Nov 8 22:37:05 2005 +++ b/tools/python/xen/xend/XendDomainInfo.py Tue Nov 8 22:37:21 2005 @@ -427,13 +427,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@lists.xensource.com http://lists.xensource.com/xen-devel
Ewan Mellor
2005-Nov-15 16:31 UTC
Re: [Xen-devel] [PATCH 2/2][RESEND] xend: fix vcpu related items
On Tue, Nov 08, 2005 at 05:22:42PM -0600, Ryan Harper wrote:> Resending, rediffed against changeset: 7701:abbe3df33774 > > 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.Applied, thanks. Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel