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: certainly cleanup qemu-dm related stuffs on de

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xend: certainly cleanup qemu-dm related stuffs on destroy
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Fri, 17 Apr 2009 13:40:55 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 16 Apr 2009 21:41:28 -0700
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
Some qemu-dm related stuffs might be left behind after the domain is destroyed.
 - xenstore entry, /local/domain/0/device-model/<domid>
 - named pipes, /var/run/tap/qemu-{read,write}-<domid>

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r 573e6673e9e0 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Wed Apr 15 15:47:25 2009 +0100
+++ b/tools/python/xen/xend/image.py    Fri Apr 17 09:31:32 2009 +0900
@@ -561,9 +561,9 @@ class ImageHandler:
     def destroyDeviceModel(self):
         if self.device_model is None:
             return
-        if self.pid:
-            self.sentinel_lock.acquire()
-            try:
+        self.sentinel_lock.acquire()
+        try:
+            if self.pid:
                 try:
                     os.kill(self.pid, signal.SIGHUP)
                 except OSError, exn:
@@ -592,22 +592,22 @@ class ImageHandler:
                     except OSError:
                         # This happens if the process doesn't exist.
                         pass
-                state = xstransact.Remove("/local/domain/0/device-model/%i"
-                                          % self.vm.getDomid())
-            finally:
-                self.pid = None
-                self.sentinel_lock.release()
+        finally:
+            self.pid = None
+            self.sentinel_lock.release()
             
-            try:
-                os.unlink('/var/run/tap/qemu-read-%d' % self.vm.getDomid())
-                os.unlink('/var/run/tap/qemu-write-%d' % self.vm.getDomid())
-            except:
-                pass
-            try:
-                del sentinel_fifos_inuse[self.sentinel_path_fifo]
-                os.unlink(self.sentinel_path_fifo)
-            except:
-                pass
+        state = xstransact.Remove("/local/domain/0/device-model/%i"
+                                  % self.vm.getDomid())
+        try:
+            os.unlink('/var/run/tap/qemu-read-%d' % self.vm.getDomid())
+            os.unlink('/var/run/tap/qemu-write-%d' % self.vm.getDomid())
+        except:
+            pass
+        try:
+            del sentinel_fifos_inuse[self.sentinel_path_fifo]
+            os.unlink(self.sentinel_path_fifo)
+        except:
+            pass
 
     def setCpuid(self):
         xc.domain_set_policy_cpuid(self.vm.getDomid())
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xend: certainly cleanup qemu-dm related stuffs on destroy, Kouya Shimura <=