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] Mark save record fd close-on-exec

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Mark save record fd close-on-exec after calling xc_restore
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Mar 2007 07:50:09 -0700
Delivery-date: Wed, 14 Mar 2007 07:49:49 -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 Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1173876580 0
# Node ID 35c9a1939ae43e62d56666b59d2db3da1c8f9d37
# Parent  4d7327502ba6e5776f22c80e541f9298ee0692d5
[XEND] Mark save record fd close-on-exec after calling xc_restore
so that qemu doesn't end up with an open fd on it
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendCheckpoint.py |   10 ++++++++++
 1 files changed, 10 insertions(+)

diff -r 4d7327502ba6 -r 35c9a1939ae4 tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Wed Mar 14 11:38:26 2007 +0000
+++ b/tools/python/xen/xend/XendCheckpoint.py   Wed Mar 14 12:49:40 2007 +0000
@@ -9,6 +9,7 @@ import re
 import re
 import string
 import threading
+import fcntl
 from struct import pack, unpack, calcsize
 
 from xen.util.xpopen import xPopen3
@@ -230,6 +231,15 @@ def restore(xd, fd, dominfo = None, paus
 
         forkHelper(cmd, fd, handler.handler, True)
 
+        # We don't want to pass this fd to any other children -- we 
+        # might need to recover ths disk space that backs it.
+        try:
+            flags = fcntl.fcntl(fd, fcntl.F_GETFD)
+            flags |= fcntl.FD_CLOEXEC
+            fcntl.fcntl(fd, fcntl.F_SETFD, flags)
+        except:
+            pass
+
         if handler.store_mfn is None:
             raise XendError('Could not read store MFN')
 

_______________________________________________
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] Mark save record fd close-on-exec after calling xc_restore, Xen patchbot-unstable <=