mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
[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@xensource.com>
This commit is contained in:
1 parent
8ff2288a9a
commit
0bf25ed4be
1 file changed
+10
@@ -9,6 +9,7 @@ import os
|
||||
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, paused = False):
|
||||
|
||||
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')
|
||||
|
||||
|
||||