[libvirt] [PATCH 33/34] Add network events to the remote driver
Daniel P. Berrange
berrange at redhat.com
Fri Nov 29 17:34:40 UTC 2013
On Fri, Nov 29, 2013 at 04:19:09PM +0100, Cédric Bosdonnat wrote:
> ---
> daemon/libvirtd.h | 1 +
> daemon/remote.c | 139 +++++++++++++++++++++++++++++++++++++++++++
> src/remote/remote_driver.c | 126 +++++++++++++++++++++++++++++++++++++++
> src/remote/remote_protocol.x | 46 +++++++++++++-
> 4 files changed, 311 insertions(+), 1 deletion(-)
ACK
> +static int
> +remoteDispatchConnectNetworkEventRegisterAny(virNetServerPtr server ATTRIBUTE_UNUSED,
> + virNetServerClientPtr client ATTRIBUTE_UNUSED,
> + virNetMessagePtr msg ATTRIBUTE_UNUSED,
> + virNetMessageErrorPtr rerr ATTRIBUTE_UNUSED,
> + remote_connect_network_event_register_any_args *args,
> + remote_connect_network_event_register_any_ret *ret ATTRIBUTE_UNUSED)
> +{
> + int callbackID;
> + int rv = -1;
> + struct daemonClientPrivate *priv =
> + virNetServerClientGetPrivateData(client);
> +
> + if (!priv->conn) {
> + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
> + goto cleanup;
> + }
> +
> + virMutexLock(&priv->lock);
> +
> + if ((args->eventID & 0xFF) >= VIR_NETWORK_EVENT_ID_LAST ||
> + ((args->eventID & 0xFF00) >> 8) != VIR_EVENT_NAMESPACE_NETWORK) {
> + virReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported event ID %d"), args->eventID);
> + goto cleanup;
> + }
Not sure I see why you're checking the namespace here. This API only ever handles the
network events, so shouldn't eventID just directly reflect the EVENT_ID passed in by
the application to the register API call
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the libvir-list
mailing list