mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-29 00:55:22 +00:00
995b2ebab6
On the surface, this sequence of API calls should succeed: id1 = virConnectDomainEventRegisterAny(..., VIR_DOMAIN_EVENT_ID_LIFECYCLE,...); id2 = virConnectDomainEventRegisterAny(..., VIR_DOMAIN_EVENT_ID_RTC_CHANGE,...); virConnectDomainEventDeregisterAny(id1); id1 = virConnectDomainEventRegisterAny(..., VIR_DOMAIN_EVENT_ID_LIFECYCLE,...); And for test:///default, it does. But for qemu:///system, it fails: libvirt: XML-RPC error : internal error: domain event 0 already registered Looking closer, the bug is caused by miscommunication between the object event engine and the client side of the remote driver. In our implementation, we set up a single server-side event per eventID, then the client side replicates that one event to all callbacks that have been registered client side. To know when to turn the server side eventID on or off, the client side must track how many events for the same eventID have been registered. But while our code was filtering by eventID on event registration, it did not filter on event deregistration. So the above API calls resulted in the deregister returning 1 instead of 0, so no RPC deregister was issued, and the final register detects on the server side that the server is already handling eventID 0. Unfortunately, since the problem is only observable on remote connections, it's not possible to enhance objecteventtest to expose the semantics using only public API entry points. * src/conf/object_event.c (virObjectEventCallbackListCount): New function. (virObjectEventCallbackListAddID) (virObjectEventCallbackListRemoveID) (virObjectEventCallbackListMarkDeleteID): Use it. Signed-off-by: Eric Blake <eblake@redhat.com> |
||
---|---|---|
.. | ||
capabilities.c | ||
capabilities.h | ||
cpu_conf.c | ||
cpu_conf.h | ||
device_conf.c | ||
device_conf.h | ||
domain_audit.c | ||
domain_audit.h | ||
domain_conf.c | ||
domain_conf.h | ||
domain_event.c | ||
domain_event.h | ||
domain_nwfilter.c | ||
domain_nwfilter.h | ||
interface_conf.c | ||
interface_conf.h | ||
netdev_bandwidth_conf.c | ||
netdev_bandwidth_conf.h | ||
netdev_vlan_conf.c | ||
netdev_vlan_conf.h | ||
netdev_vport_profile_conf.c | ||
netdev_vport_profile_conf.h | ||
network_conf.c | ||
network_conf.h | ||
network_event.c | ||
network_event.h | ||
node_device_conf.c | ||
node_device_conf.h | ||
nwfilter_conf.c | ||
nwfilter_conf.h | ||
nwfilter_ipaddrmap.c | ||
nwfilter_ipaddrmap.h | ||
nwfilter_params.c | ||
nwfilter_params.h | ||
object_event_private.h | ||
object_event.c | ||
object_event.h | ||
secret_conf.c | ||
secret_conf.h | ||
snapshot_conf.c | ||
snapshot_conf.h | ||
storage_conf.c | ||
storage_conf.h | ||
storage_encryption_conf.c | ||
storage_encryption_conf.h | ||
virchrdev.c | ||
virchrdev.h |