eventLoopThread = threading.Thread(target=virEventLoopNativeRun, name=
    'libvirtEventLoop')
eventLoopThread.setDaemon(True)
eventLoopThread.start()
if __name__ == '__main__':
    virEventLoopNativeStart()
conn = libvirt.openReadOnly('qemu:///system')
conn.domainEventRegister(callback, None)
conn.setKeepAlive(5, 3)
while conn.isAlive() == 1:
    time.sleep(1)
Can I register event callbacks using the libvirt Python module with a QEMU backend?