mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
Don't register events unless libvirt is new enough
Python callbacks for custom event loops changed signature, so only use newer impls.
This commit is contained in:
parent
5f7d061e6f
commit
26c49f7d6e
@ -19,6 +19,7 @@
|
||||
#
|
||||
|
||||
import threading
|
||||
import logging
|
||||
|
||||
import gobject
|
||||
|
||||
@ -234,6 +235,11 @@ def glib_event_timeout_remove(timer):
|
||||
state.lock.release()
|
||||
|
||||
def register_event_impl():
|
||||
if (hasattr(libvirt, "eventInvokeHandleCallback") and
|
||||
not hasattr(libvirt, "_eventInvokeHandleCallback")):
|
||||
logging.debug("Libvirt version is not new enough for our event loop "
|
||||
"impl. Skipping registration.")
|
||||
return
|
||||
libvirt.virEventRegisterImpl(glib_event_handle_add,
|
||||
glib_event_handle_update,
|
||||
glib_event_handle_remove,
|
||||
|
Loading…
Reference in New Issue
Block a user