diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2010-03-18 14:56:56 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2010-03-26 13:52:29 +0000 |
commit | 097e07a63aff96e2f9483b33f799d59674e72d11 (patch) | |
tree | 592f03512526172a08b2db1e734a3b551b56ce10 /daemon/libvirtd.h | |
parent | Support new event register/deregister APis in all drivers except remote (diff) | |
download | libvirt-097e07a63aff96e2f9483b33f799d59674e72d11.tar.gz libvirt-097e07a63aff96e2f9483b33f799d59674e72d11.tar.bz2 libvirt-097e07a63aff96e2f9483b33f799d59674e72d11.zip |
Remote driver & daemon impl of new event API
This wires up the remote driver to handle the new events APIs.
The public API allows an application to request a callback filters
events to a specific domain object, and register multiple callbacks
for the same event type. On the wire there are two strategies for
this
- Register multiple callbacks with the remote daemon, each
with filtering as needed
- Register only one callback per event type, with no filtering
Both approaches have potential inefficiency. In the first scheme,
the same event gets sent over the wire many times if multiple
callbacks are registered. With the second scheme, unneccessary
events get sent over the wire if a per-domain filter is set on
the client. The second scheme is far easier to implement though,
so this patch takes that approach.
* daemon/dispatch.h: Don't export remoteRelayDomainEvent since it
is no longer needed for unregistering callbacks, instead the
unique callback ID is used
* daemon/libvirtd.c, daemon/libvirtd.h: Track and unregister
callbacks based on callback ID, instead of function pointer
* daemon/remote.c: Switch over to using virConnectDomainEventRegisterAny
instead of legacy virConnectDomainEventRegister function. Refactor
remoteDispatchDomainEventSend() to cope with arbitrary event types
* src/driver.h, src/driver.c: Move verify() call into source file
instead of header, to avoid polluting the global namespace with
the verify function name
* src/remote/remote_driver.c: Implement new APIs for event
registration. Refactor processCallDispatchMessage() to cope
with arbitrary incoming event types. Merge remoteDomainQueueEvent()
into processCallDispatchMessage() to avoid duplication of code.
Rename remoteDomainReadEvent() to remoteDomainReadEventLifecycle()
* src/remote/remote_protocol.x: Define wire format for the new
virConnectDomainEventRegisterAny and virConnectDomainEventDeregisterAny
functions
Diffstat (limited to 'daemon/libvirtd.h')
-rw-r--r-- | daemon/libvirtd.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/daemon/libvirtd.h b/daemon/libvirtd.h index d30fcd725..d29268100 100644 --- a/daemon/libvirtd.h +++ b/daemon/libvirtd.h @@ -177,7 +177,7 @@ struct qemud_client { int watch; unsigned int readonly :1; unsigned int closing :1; - unsigned int domain_events_registered :1; + int domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LAST]; struct sockaddr_storage addr; socklen_t addrlen; |