[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.4-testing] xend: destroy stubdoms synchronously



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1256289628 -3600
# Node ID 7bd37c5c72893a783a00b3068df0c81b3ceb911c
# Parent  9c2328a6f768265646da64094fe9a58134e2e0e6
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>
xen-unstable changeset:   20315:cc8044c5da4c
xen-unstable date:        Thu Oct 15 08:16:42 2009 +0100
---
 stubdom/stubdom-dm                      |    8 ++------
 tools/python/xen/xend/XendDomainInfo.py |    8 ++++++++
 tools/python/xen/xend/image.py          |    6 +++++-
 3 files changed, 15 insertions(+), 7 deletions(-)

diff -r 9c2328a6f768 -r 7bd37c5c7289 stubdom/stubdom-dm
--- a/stubdom/stubdom-dm        Fri Oct 23 10:19:58 2009 +0100
+++ b/stubdom/stubdom-dm        Fri Oct 23 10:20:28 2009 +0100
@@ -69,12 +69,8 @@ done
 
 term() {
     kill %1
-    (
-       [ -n "$vncpid" ] && kill -9 $vncpid
-       rm /etc/xen/stubdoms/$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 /etc/xen/stubdoms/$domname-dm
     exit 0
 }
 
diff -r 9c2328a6f768 -r 7bd37c5c7289 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Oct 23 10:19:58 2009 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Oct 23 10:20:28 2009 +0100
@@ -1737,6 +1737,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 9c2328a6f768 -r 7bd37c5c7289 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Fri Oct 23 10:19:58 2009 +0100
+++ b/tools/python/xen/xend/image.py    Fri Oct 23 10:20:28 2009 +0100
@@ -561,7 +561,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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.