Disable libguestfs' default atexit handlers.

These aren't safe for multi-threaded applications, per the bug
report from Daniel Berrange.

Closes-bug: #1261475

Change-Id: I4cc5eaded2e21f1b2cd55615242a27b9773f0b42
This commit is contained in:
Michael Still 2013-12-30 10:55:20 +11:00
parent 6df885f87c
commit 02abbef960
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@
class GuestFS(object): class GuestFS(object):
def __init__(self): def __init__(self, close_on_exit=True):
self.drives = [] self.drives = []
self.running = False self.running = False
self.closed = False self.closed = False

View File

@ -108,7 +108,7 @@ class VFSGuestFS(vfs.VFS):
def setup(self): def setup(self):
LOG.debug(_("Setting up appliance for %(imgfile)s %(imgfmt)s") % LOG.debug(_("Setting up appliance for %(imgfile)s %(imgfmt)s") %
{'imgfile': self.imgfile, 'imgfmt': self.imgfmt}) {'imgfile': self.imgfile, 'imgfmt': self.imgfmt})
self.handle = tpool.Proxy(guestfs.GuestFS()) self.handle = tpool.Proxy(guestfs.GuestFS(close_on_exit=False))
try: try:
self.handle.add_drive_opts(self.imgfile, format=self.imgfmt) self.handle.add_drive_opts(self.imgfile, format=self.imgfmt)