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: destroy stubdoms synchronously

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: destroy stubdoms synchronously
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Oct 2009 01:40:16 -0700
Delivery-date: Thu, 15 Oct 2009 01:40:51 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 1255591002 -3600
# Node ID cc8044c5da4c99149bc8aca68de299db8aa56b45
# Parent  18758847bf313a191731278c41af7519dfa85ecf
xend: destroy stubdoms synchronously

This patch makes the destruction of stubdoms a synchronous event,
therefore it is no longer possible to run out of memory when rebooting
a guest because the stubdom of the old guest is always destroyed
before the creation of the new guest.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 stubdom/stubdom-dm                      |    8 ++------
 tools/python/xen/xend/XendDomainInfo.py |   18 ++++++++++++------
 tools/python/xen/xend/image.py          |    6 +++++-
 3 files changed, 19 insertions(+), 13 deletions(-)

diff -r 18758847bf31 -r cc8044c5da4c stubdom/stubdom-dm
--- a/stubdom/stubdom-dm        Wed Oct 14 09:09:23 2009 +0100
+++ b/stubdom/stubdom-dm        Thu Oct 15 08:16:42 2009 +0100
@@ -81,12 +81,8 @@ done
 
 term() {
     kill %1
-    (
-       [ -n "$vncpid" ] && kill -9 $vncpid
-       rm ${stubdom_configdir}/$domname-dm
-       xm destroy $domname-dm
-    ) &
-    # We need to exit immediately so as to let xend do the commands above
+    [ -n "$vncpid" ] && kill -9 $vncpid
+    rm ${stubdom_configdir}/$domname-dm
     exit 0
 }
 
diff -r 18758847bf31 -r cc8044c5da4c tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Oct 14 09:09:23 2009 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Thu Oct 15 08:16:42 2009 +0100
@@ -855,12 +855,10 @@ class XendDomainInfo:
         dev_config = pci_convert_sxp_to_dict(dev_sxp)
         dev = dev_config['devs'][0]
 
-        dom_list = xstransact.List('/local/domain')
-        for d in dom_list:
-            target = xstransact.Read('/local/domain/' + d + '/target')
-            if target is not None and int(target) is self.domid :
-                from xen.xend import XendDomain
-                
XendDomain.instance().domain_lookup(int(d)).pci_device_configure(dev_sxp[:])
+        stubdomid = self.getStubdomDomid()
+        if stubdomid is not None :
+            from xen.xend import XendDomain
+            
XendDomain.instance().domain_lookup(stubdomid).pci_device_configure(dev_sxp[:])
 
         # Do HVM specific processing
         if self.info.is_hvm():
@@ -1810,6 +1808,14 @@ class XendDomainInfo:
     def getDomid(self):
         return self.domid
 
+    def getStubdomDomid(self):
+        dom_list = xstransact.List('/local/domain')
+        for d in dom_list:
+            target = xstransact.Read('/local/domain/' + d + '/target')
+            if target is not None and int(target) is self.domid :
+                return int(d)
+        return None
+
     def setName(self, name, to_store = True):
         self._checkName(name)
         self.info['name_label'] = name
diff -r 18758847bf31 -r cc8044c5da4c tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Wed Oct 14 09:09:23 2009 +0100
+++ b/tools/python/xen/xend/image.py    Thu Oct 15 08:16:42 2009 +0100
@@ -591,7 +591,11 @@ class ImageHandler:
             return
         self.sentinel_lock.acquire()
         try:
-            if self.pid:
+            stubdomid = self.vm.getStubdomDomid()
+            if stubdomid is not None :
+                from xen.xend import XendDomain
+                XendDomain.instance().domain_destroy(stubdomid)
+            elif self.pid:
                 try:
                     os.kill(self.pid, signal.SIGHUP)
                 except OSError, exn:

_______________________________________________
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: destroy stubdoms synchronously, Xen patchbot-unstable <=