def virEventLoopNativeRun():
    while True:
        libvirt.virEventRunDefaultImpl()

def virEventLoopNativeStart():
    global eventLoopThread
libvirt.virEventRegisterDefaultImpl()
eventLoopThread = threading.Thread(target=virEventLoopNativeRun, name=
    'libvirtEventLoop')
eventLoopThread.setDaemon(True)
eventLoopThread.start()
if __name__ == '__main__':
    virEventLoopNativeStart()
Can I register event callbacks using the libvirt Python module with a QEMU backend?