From: Kouya Shimura Subject: [PATCH] xend: certainly cleanup qemu-dm related stuffs on destroy Date: Fri, 17 Apr 2009 13:40:55 +0900 Message-ID: <7ky6tzj3jb.fsf@pingu.sky.yk.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="K4uldHkaR5" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --K4uldHkaR5 Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit Some qemu-dm related stuffs might be left behind after the domain is destroyed. - xenstore entry, /local/domain/0/device-model/ - named pipes, /var/run/tap/qemu-{read,write}- Signed-off-by: Kouya Shimura --K4uldHkaR5 Content-Type: text/x-patch Content-Disposition: inline; filename="cleanup_qemu.patch" Content-Transfer-Encoding: 7bit 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()) --K4uldHkaR5 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --K4uldHkaR5--