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] [xen-unstable] [XEND] Fix xm vcpu-set when decrementing

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Fix xm vcpu-set when decrementing VCPU count
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 08 Dec 2006 13:20:47 +0000
Delivery-date: Fri, 08 Dec 2006 05:24:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 Alastair Tse <atse@xxxxxxxxxxxxx>
# Node ID 8beecb8c5ae29660b2c6073c25a329cc1d9240f6
# Parent  d3846d6f30d5122b8ac379713dde39b0310fa4d7
[XEND] Fix xm vcpu-set when decrementing VCPU count

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendConfig.py     |    5 ++++-
 tools/python/xen/xend/XendDomainInfo.py |   14 +++++++++++---
 tools/python/xen/xm/main.py             |    2 +-
 3 files changed, 16 insertions(+), 5 deletions(-)

diff -r d3846d6f30d5 -r 8beecb8c5ae2 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Fri Dec 08 10:48:46 2006 +0000
+++ b/tools/python/xen/xend/XendConfig.py       Fri Dec 08 11:08:26 2006 +0000
@@ -632,6 +632,9 @@ class XendConfig(dict):
         self['memory_dynamic_max'] = self['memory_static_max']
         self['memory_dynamic_min'] = self['memory_static_min']
 
+        # make sure max_vcpu_id is set correctly
+        self['max_vcpu_id'] = self['vcpus_number'] - 1
+
         # set device references in the configuration
         self['devices'] = cfg.get('devices', {})
         
@@ -714,7 +717,7 @@ class XendConfig(dict):
         _set_cfg_if_exists('on_xend_stop')
         _set_cfg_if_exists('on_xend_start')
         _set_cfg_if_exists('vcpu_avail')
-        _set_cfg_if_exists('max_vcpu_id') # TODO, deprecated?
+        _set_cfg_if_exists('max_vcpu_id') # needed for vcpuDomDetails
         
         # Parse and store runtime configuration 
         _set_cfg_if_exists('start_time')
diff -r d3846d6f30d5 -r 8beecb8c5ae2 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Dec 08 10:48:46 2006 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Dec 08 11:08:26 2006 +0000
@@ -876,10 +876,18 @@ class XendDomainInfo:
 
     def setVCpuCount(self, vcpus):
         self.info['vcpu_avail'] = (1 << vcpus) - 1
-        self.info['vcpus_number'] = vcpus
         self.storeVm('vcpu_avail', self.info['vcpu_avail'])
-        self.storeVm('vcpus', self.info['vcpus_number'])
-        self._writeDom(self._vcpuDomDetails())
+        # update dom differently depending on whether we are adjusting
+        # vcpu number up or down, otherwise _vcpuDomDetails does not
+        # disable the vcpus
+        if self.info['vcpus_number'] > vcpus:
+            # decreasing
+            self._writeDom(self._vcpuDomDetails())
+            self.info['vcpus_number'] = vcpus
+        else:
+            # same or increasing
+            self.info['vcpus_number'] = vcpus
+            self._writeDom(self._vcpuDomDetails())
 
     def getLabel(self):
         return security.get_security_info(self.info, 'label')
diff -r d3846d6f30d5 -r 8beecb8c5ae2 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Fri Dec 08 10:48:46 2006 +0000
+++ b/tools/python/xen/xm/main.py       Fri Dec 08 11:08:26 2006 +0000
@@ -643,7 +643,7 @@ def parse_doms_info(info):
         'domid'    : get_info('domid',        str,   ''),
         'name'     : get_info('name',         str,   '??'),
         'mem'      : get_info('memory_dynamic_min', int,   0),
-        'vcpus'    : get_info('vcpus',        int,   0),
+        'vcpus'    : get_info('online_vcpus',        int,   0),
         'state'    : get_info('state',        str,    ''),
         'cpu_time' : get_info('cpu_time',     float, 0),
         'up_time'  : up_time,

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEND] Fix xm vcpu-set when decrementing VCPU count, Xen patchbot-unstable <=