Re: [PATCH v4 1/7] Added Network events API and virNetworkEventLifecycle.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 11, 2013 at 11:37:58AM +0100, Cédric Bosdonnat wrote:
> diff --git a/src/conf/network_event.c b/src/conf/network_event.c
> new file mode 100644
> index 0000000..74e9d3d
> --- /dev/null
> +++ b/src/conf/network_event.c

> +int
> +virNetworkEventStateRegisterID(virConnectPtr conn,
> +                              virObjectEventStatePtr state,
> +                              virNetworkPtr net,
> +                              int eventID,
> +                              virConnectObjectEventGenericCallback cb,
> +                              void *opaque,
> +                              virFreeCallback freecb,
> +                              int *callbackID)

Small indentation bug I'll fix when pushing.

> +{
> +    int nsEventID = (VIR_EVENT_NAMESPACE_NETWORK << 8) + eventID;
> +    if (net)
> +        return virObjectEventStateRegisterID(conn, state,
> +                                             net->uuid, net->name, 0, nsEventID,
> +                                             cb, opaque, freecb, callbackID);
> +    else
> +        return virObjectEventStateRegisterID(conn, state,
> +                                             NULL, NULL, 0, nsEventID,
> +                                             cb, opaque, freecb, callbackID);
> +}
> +
> +void
> +*virNetworkEventLifecycleNew(const char *name,
> +                             const unsigned char *uuid,
> +                             int type)

The return type should be virObjectEventPtr - will fix

> +{
> +    virNetworkEventLifecyclePtr event;
> +    int eventId = (VIR_EVENT_NAMESPACE_NETWORK << 8) + VIR_NETWORK_EVENT_ID_LIFECYCLE;
> +
> +    if (virNetworkEventsInitialize() < 0)
> +        return NULL;
> +
> +    if (!(event = virObjectEventNew(virNetworkEventLifecycleClass,
> +                                    eventId,
> +                                    0, name, uuid)))
> +        return NULL;
> +
> +    event->type = type;
> +
> +    return event;
> +}

> +int
> +virNetworkEventStateRegisterID(virConnectPtr conn,
> +                              virObjectEventStatePtr state,
> +                              virNetworkPtr net,
> +                              int eventID,
> +                              virConnectObjectEventGenericCallback cb,
> +                              void *opaque,
> +                              virFreeCallback freecb,
> +                              int *callbackID);

Same indent issue

> +
> +void
> +*virNetworkEventLifecycleNew(const char *name,
> +                             const unsigned char *uuid,
> +                             int type);
> +
> +void
> +virNetworkEventDispatchDefaultFunc(virConnectPtr conn,
> +                                   virObjectEventPtr event,
> +                                   virConnectNetworkEventGenericCallback cb,
> +                                   void *cbopaque,
> +                                   void *opaque);
> +#endif
> +
> +typedef int
> +(*virDrvConnectNetworkEventDeregisterAny)(virConnectPtr conn,
> +                                         int callbackID);

Tiny indent issue.

> diff --git a/src/libvirt.c b/src/libvirt.c
> index b3543d0..97175b2 100644
> --- a/src/libvirt.c
> +++ b/src/libvirt.c
> +int
> +virConnectNetworkEventDeregisterAny(virConnectPtr conn,
> +                                    int callbackID)
> +{
> +    VIR_DEBUG("conn=%p, callbackID=%d", conn, callbackID);
> +
> +    virResetLastError();
> +
> +    if (!VIR_IS_CONNECT(conn)) {
> +        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
> +        virDispatchError(NULL);
> +        return -1;
> +    }
> +    virCheckNonNegativeArgGoto(callbackID, error);
> +
> +    if ((conn->networkDriver) &&
> +            (conn->networkDriver->connectNetworkEventDeregisterAny)) {

Small indent issue


ACK will push with fixes

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 :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]