From 02abbef960b12deaa7a911788dbc56f3a0bd555a Mon Sep 17 00:00:00 2001 From: Michael Still Date: Mon, 30 Dec 2013 10:55:20 +1100 Subject: [PATCH] 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 --- nova/tests/fakeguestfs.py | 2 +- nova/virt/disk/vfs/guestfs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/tests/fakeguestfs.py b/nova/tests/fakeguestfs.py index d940478dcd62..cf35a6f01ad7 100644 --- a/nova/tests/fakeguestfs.py +++ b/nova/tests/fakeguestfs.py @@ -17,7 +17,7 @@ class GuestFS(object): - def __init__(self): + def __init__(self, close_on_exit=True): self.drives = [] self.running = False self.closed = False diff --git a/nova/virt/disk/vfs/guestfs.py b/nova/virt/disk/vfs/guestfs.py index 99d620cd99ab..722f2fc3a020 100644 --- a/nova/virt/disk/vfs/guestfs.py +++ b/nova/virt/disk/vfs/guestfs.py @@ -108,7 +108,7 @@ class VFSGuestFS(vfs.VFS): def setup(self): LOG.debug(_("Setting up appliance for %(imgfile)s %(imgfmt)s") % {'imgfile': self.imgfile, 'imgfmt': self.imgfmt}) - self.handle = tpool.Proxy(guestfs.GuestFS()) + self.handle = tpool.Proxy(guestfs.GuestFS(close_on_exit=False)) try: self.handle.add_drive_opts(self.imgfile, format=self.imgfmt)