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@sun.com>
xen-unstable changeset: 16106:
628f8ec692a0153af03a81b04f41b9edfcca7aad
xen-unstable date: Fri Oct 12 14:30:41 2007 +0100
self.domains_lock.acquire()
try:
try:
+ fd = None
dominfo = self.domain_lookup_nr(domname)
if not dominfo:
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)
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()