mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-24 15:26:36 -06:00
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:
parent
bd5b285eea
commit
006fcd3856
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user