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-devel

[Xen-devel] [PATCH] xend: avoid call to XendDomainInfo.recreate() while

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xend: avoid call to XendDomainInfo.recreate() while creating domain
From: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Date: Tue, 22 Mar 2011 14:14:52 +0100
Delivery-date: Tue, 22 Mar 2011 06:15:33 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:subject:date:message-id:x-mailer :content-type:mime-version:content-transfer-encoding :x-mercurial-node:user-agent; bh=d8evabEZtRYW/i3YbuZ8ZKgyxiLlaBuqv8hwh+l3MnM=; b=Zv/qiEox+nC1wEPChW3FmNV9LRzYAgYZLcM+f+FXSAQfZiRtUsfuduVk9yIPdSgMQX LaaOeR4EOtH+Qmaz6ZwxEd9D29NRi9WLyfIrao3bIy/XumTo23oIxnleCCX2mg65Ammm +rTowCq0w6pVbNYl+erXJ+GJWd0KV1cbECr4Y=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:content-type :mime-version:content-transfer-encoding:x-mercurial-node:user-agent; b=nRInhLbheO6scPgDbHiCtMGb3ObvqdaAxK6NWZTUEzPcHxmL/zz3qYlAHEm8VrTEy5 NspVjp35j3VUGkSJMKKPLT+sB93mYcI0/7F9MTRvbuSaJAzj3aAj4qI7TZ2dfn/9KmJI RvT9vjxES9I5pWkirvSrj4ROtDMGeopNyof/U=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.7.5
# HG changeset patch
# User Paolo Bonzini <pbonzini@xxxxxxxxxx>
# Date 1300799548 -3600
# Node ID e1452f8088dc667ca57cc1c5a63983a5131d1314
# Parent  c639f0afaa74591d1053677b0a6348503a14fd78
avoid call to XendDomainInfo.recreate() while creating domain.

We observed xend failing to create a new domain on NUMA machines
in some cases.  The culprit is find_relaxed_node() which calls
XendDomain.instance().list():

                 from xen.xend import XendDomain
                 doms = XendDomain.instance().list('all')
                 for dom in filter (lambda d: d.domid != self.domid, doms):

Depending on the state of the XendDomain singleton, XendDomain._refresh
may call XendDomainInfo.recreate(); this one fails because the domain
info hasn't been initialized yet, so that self.info['memory'] is zero.
XendDomain then decides things are broken beyond repair, and destroys
the domain.

This patch skips the refresh in this case, and fixes the problem.

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>

diff --git a/tools/python/xen/xend/XendDomain.py 
b/tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py
+++ b/tools/python/xen/xend/XendDomain.py
@@ -825,7 +825,7 @@ class XendDomain:
     # ------------------------------------------------------------
     # Xen Legacy API     
 
-    def list(self, state = DOM_STATE_RUNNING):
+    def list(self, state = DOM_STATE_RUNNING, refresh = True):
         """Get list of domain objects.
 
         @param: the state in which the VMs should be -- one of the
@@ -844,7 +844,7 @@ class XendDomain:
                 break
             count += 1
         try:
-            if resu:
+            if resu and refresh:
                 self._refresh(refresh_shutdown = False)
             
             # active domains
diff --git a/tools/python/xen/xend/XendDomainInfo.py 
b/tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -2726,7 +2726,7 @@ class XendDomainInfo:
                 nodeload = [0]
                 nodeload = nodeload * nr_nodes
                 from xen.xend import XendDomain
-                doms = XendDomain.instance().list('all')
+                doms = XendDomain.instance().list('all', False)
                 for dom in filter (lambda d: d.domid != self.domid, doms):
                     cpuinfo = dom.getVCPUInfo()
                     for vcpu in sxp.children(cpuinfo, 'vcpu'):



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

<Prev in Thread] Current Thread [Next in Thread>