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-3.2-testing] Fix xm vcpu-pin for inactive managed d

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.2-testing] Fix xm vcpu-pin for inactive managed domains
From: "Xen patchbot-3.2-testing" <patchbot-3.2-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 06 Mar 2008 00:31:10 -0800
Delivery-date: Thu, 06 Mar 2008 00:31:57 -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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1204733992 0
# Node ID 5b81e69b28f1b853c56b10c31f98b281c859258e
# Parent  dfe09df4e588984f7befd4ff30439ce3c29e904d
Fix xm vcpu-pin for inactive managed domains

We cannot currently change cpu affinity definitions of inactive
managed domains by xm vcpu-pin command. This patch enables changing
cpu affinity definitions of inactive managed domains. However, we
cannot change cpu affinity definitions to each vcpu because we cannot
currently define cpu affinity definitions to each vcpu to domain
configuration definitions.  Therefore, we need to specify 'all' to
VCPU argument of xm vcpu-pin command.

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
xen-unstable changeset:   17173:a142ddb40b1c77d6b8726a2b57ac324ab74c6d06
xen-unstable date:        Mon Mar 03 11:09:33 2008 +0000
---
 tools/python/xen/xend/XendDomain.py     |   24 +++++++++++++++++-------
 tools/python/xen/xend/XendDomainInfo.py |    6 ++++++
 2 files changed, 23 insertions(+), 7 deletions(-)

diff -r dfe09df4e588 -r 5b81e69b28f1 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Wed Mar 05 16:19:20 2008 +0000
+++ b/tools/python/xen/xend/XendDomain.py       Wed Mar 05 16:19:52 2008 +0000
@@ -1359,13 +1359,23 @@ class XendDomain:
        
         # set the same cpumask for all vcpus
         rc = 0
-        for v in vcpus:
-            try:
-                rc = xc.vcpu_setaffinity(dominfo.getDomid(), int(v), cpumap)
-            except Exception, ex:
-                log.exception(ex)
-                raise XendError("Cannot pin vcpu: %s to cpu: %s - %s" % \
-                                (v, cpumap, str(ex)))
+        if dominfo._stateGet() in (DOM_STATE_RUNNING, DOM_STATE_PAUSED):
+            for v in vcpus:
+                try:
+                    rc = xc.vcpu_setaffinity(dominfo.getDomid(), int(v), 
cpumap)
+                except Exception, ex:
+                    log.exception(ex)
+                    raise XendError("Cannot pin vcpu: %s to cpu: %s - %s" % \
+                                    (v, cpumap, str(ex)))
+        else:
+            # FIXME: if we could define cpu affinity definitions to
+            #        each vcpu, reprogram the following processing.
+            if str(vcpu).lower() != "all":
+                raise XendError("Must specify 'all' to VCPU "
+                                "for inactive managed domains")
+            dominfo.setCpus(cpumap)
+            self.managed_config_save(dominfo)
+
         return rc
 
     def domain_cpu_sedf_set(self, domid, period, slice_, latency, extratime,
diff -r dfe09df4e588 -r 5b81e69b28f1 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Mar 05 16:19:20 2008 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Mar 05 16:19:52 2008 +0000
@@ -1188,6 +1188,12 @@ class XendDomainInfo:
     def setResume(self, isresume):
         self._resume = isresume
 
+    def getCpus(self):
+        return self.info['cpus']
+
+    def setCpus(self, cpumap):
+        self.info['cpus'] = cpumap
+
     def getCap(self):
         return self.info['vcpus_params']['cap']
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.2-testing] Fix xm vcpu-pin for inactive managed domains, Xen patchbot-3.2-testing <=