• D
    Remote driver & daemon impl of new event API · 097e07a6
    Daniel P. Berrange 提交于
    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
    097e07a6
remote.c 186.9 KB