]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
event: client RPC protocol tweaks for domain lifecycle events
authorEric Blake <eblake@redhat.com>
Wed, 8 Jan 2014 14:57:25 +0000 (07:57 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 12 Feb 2014 17:48:16 +0000 (10:48 -0700)
commit355ea626507ff74ed9b2db1c9946169cffbe256a
tree6fda197890bad3578b119d066546e99c41703c63
parentcaaf6ba1b6e21519ac58a3b79e347f48ff6fe0f0
event: client RPC protocol tweaks for domain lifecycle events

The counterpart to the server RPC additions; here, a single
function can serve both old and new calls, while incoming
events must be serviced by two different functions.  Again,
some wise choices in our XDR made it easier to share code
managing similar events.

While this only supports lifecycle events, it covers the
harder part of how Register and RegisterAny interact; the
remaining 15 events will be a mechanical change in a later
patch.  For Register, we now have a callbackID locally for
more efficient cleanup if the RPC fails; we also prefer to
use the newer RPC where we know it is supported (the older
RPC must be used if we don't know if RegisterAny is
supported).

* src/remote/remote_driver.c (remoteEvents): Register new RPC
event handler.
(remoteDomainBuildEventLifecycle): Move guts...
(remoteDomainBuildEventLifecycleHelper): ...here.
(remoteDomainBuildEventCallbackLifecycle): New function.
(remoteConnectDomainEventRegister)
(remoteConnectDomainEventDeregister)
(remoteConnectDomainEventRegisterAny)
(remoteConnectDomainEventDeregisterAny): Use new RPC when supported.
src/remote/remote_driver.c