[libvirt-users] libvirt event

Michal Privoznik mprivozn at redhat.com
Mon Aug 28 11:30:36 UTC 2017

On 08/22/2017 11:27 AM, llilulu wrote:
> libvirt
> version: 3.4.0
>     When use libvirt event in program, if I create more than one thread loop call virEventRunDefaultImp(), Is this invocation correct.

No. We don't expect more than one event loop. Although, if our code is
right (i.e. it locks correctly), it should be possible to have two or
more event loops but I have never tested that and I don't think anybody
else did. On the other hand, why do you need two event loops in the
first place? This usually means poor design.

> If correct ,what happen when event occur.is many thread process event?
>    If I invocation virEventRegisterDefault before any hypervisor connect, and invocation virEventRunDefaultImp.Then I connect a hypervisor(qemu) and register some event on this connection. I connect another hypervisor(lxc), before lxc connection, I reinvocation virEventRegisterDefault and virEventRunDefaultImp, Is this operate correct?What happen after that?

Again, why do you want to run two event loops?


More information about the libvirt-users mailing list