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: Fix file resouce leak on resume of

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Fix file resouce leak on resume of suspended managed domains.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 12 Oct 2007 14:30:17 -0700
Delivery-date: Fri, 12 Oct 2007 14:31:02 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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@xxxxxxxxxxxxx>
# Date 1192195841 -3600
# Node ID 628f8ec692a0153af03a81b04f41b9edfcca7aad
# Parent  1c4203730ff673fc440f9d202e25a5a45a429aba
xend: Fix file resouce leak on resume of suspended managed domains.

When a suspended managed domain is resumed, the checkpoint file is
removed, but xend retains a reference to the removed file. This
represents a resource leak. Fixed by ensuring that the file reference
is closed correctly.

Signed-off-by: Gary Pennington <gary.pennington@xxxxxxx>
---
 tools/python/xen/xend/XendDomain.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -r 1c4203730ff6 -r 628f8ec692a0 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Fri Oct 12 13:06:16 2007 +0100
+++ b/tools/python/xen/xend/XendDomain.py       Fri Oct 12 14:30:41 2007 +0100
@@ -886,6 +886,7 @@ class XendDomain:
         self.domains_lock.acquire()
         try:
             try:
+                fd = None
                 dominfo = self.domain_lookup_nr(domname)
 
                 if not dominfo:
@@ -908,8 +909,9 @@ class XendDomain:
                     oflags = os.O_RDONLY
                     if hasattr(os, "O_LARGEFILE"):
                         oflags |= os.O_LARGEFILE
+                    fd = os.open(chkpath, oflags)
                     XendCheckpoint.restore(self,
-                                           os.open(chkpath, oflags),
+                                           fd,
                                            dominfo,
                                            paused = start_paused)
                     os.unlink(chkpath)
@@ -921,6 +923,8 @@ class XendDomain:
                 log.exception("Exception occurred when resuming")
                 raise XendError("Error occurred when resuming: %s" % str(ex))
         finally:
+            if fd is not None:
+                os.close(fd)
             self.domains_lock.release()
 
 

_______________________________________________
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: Fix file resouce leak on resume of suspended managed domains., Xen patchbot-unstable <=