guestfs: As virt-manager is multithreaded, don't use an atexit handler.

libguestfs adds an atexit handler to clean up handles on exit.  This
is convenient in single-threaded programs, but causes problems in
multithreaded programs, for example:

https://bugzilla.redhat.com/show_bug.cgi?id=1043520

Disable the atexit handler for all guestfs handles created by
virt-manager.

Note this change requires libguestfs >= 1.20.  However the change to
config.py should ensure that if an earlier version of libguestfs is
installed it should silently fall back to not using inspection.
This commit is contained in:
Richard W.M. Jones 2013-12-16 17:47:30 +00:00 committed by Cole Robinson
parent bd5b285eea
commit 006fcd3856
2 changed files with 2 additions and 2 deletions

View File

@ -182,7 +182,7 @@ class vmmConfig(object):
try:
# Check we can open the Python guestfs module.
from guestfs import GuestFS # pylint: disable=F0401
GuestFS()
GuestFS(close_on_exit = False)
return True
except:
return False

View File

@ -163,7 +163,7 @@ class vmmInspection(vmmGObject):
vm.get_name())
return None
g = GuestFS()
g = GuestFS(close_on_exit = False)
prettyvm = conn.get_uri() + ":" + vm.get_name()
ignore = vmuuid