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-3.1-testing] xend: Fix file resouce leak on resume

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.1-testing] xend: Fix file resouce leak on resume of suspended managed domains.
From: "Xen patchbot-3.1-testing" <patchbot-3.1-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Oct 2007 11:00:29 -0700
Delivery-date: Fri, 19 Oct 2007 11:01:15 -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 22b20c9f0f65c1dbe824b7aa2433d2ef872bf859
# Parent  3a5f2601ac57a89a77f41d1c5855a6fee624465f
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>
xen-unstable changeset:   16106:628f8ec692a0153af03a81b04f41b9edfcca7aad
xen-unstable date:        Fri Oct 12 14:30:41 2007 +0100
---
 tools/python/xen/xend/XendDomain.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -r 3a5f2601ac57 -r 22b20c9f0f65 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Thu Oct 11 19:23:40 2007 +0100
+++ b/tools/python/xen/xend/XendDomain.py       Fri Oct 12 14:30:41 2007 +0100
@@ -864,6 +864,7 @@ class XendDomain:
         self.domains_lock.acquire()
         try:
             try:
+                fd = None
                 dominfo = self.domain_lookup_nr(domname)
 
                 if not dominfo:
@@ -886,8 +887,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)
@@ -899,6 +901,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-3.1-testing] xend: Fix file resouce leak on resume of suspended managed domains., Xen patchbot-3.1-testing <=