Re: [PATCH v2 6/6] event-test: support storage lifecycle event APIs

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

 



On Mon, Jun 13, 2016 at 18:38:43 +0200, Jovanka Gulicoska wrote:
> ---
>  examples/object-events/event-test.c | 46 ++++++++++++++++++++++++++++++++++++-
>  1 file changed, 45 insertions(+), 1 deletion(-)

[...]

> @@ -899,6 +933,7 @@ main(int argc, char **argv)
>      virConnectPtr dconn = NULL;
>      int callback1ret = -1;
>      int callback16ret = -1;
> +    int callback17ret = -1;
>      struct sigaction action_stop;
>      size_t i;
>  
> @@ -966,8 +1001,16 @@ main(int argc, char **argv)
>                                                        VIR_NETWORK_EVENT_CALLBACK(myNetworkEventCallback),
>                                                        strdup("net callback"), myFreeFunc);
>  
> +    callback17ret = virConnectStoragePoolEventRegisterAny(dconn,

If you follow the approach used by domain events rather than network
events the new code will automatically trigger a build failure when you
add new events and also will make addition of new storage pool callback
types much easier.

> +                                                          NULL,
> +                                                          VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE,
> +                                                          VIR_STORAGE_POOL_EVENT_CALLBACK(myStoragePoolEventCallback),
> +                                                          strdup("storage pool callback"), myFreeFunc);
> +
> +
>      if ((callback1ret == -1) ||
> -        (callback16ret == -1))
> +        (callback16ret == -1) ||
> +        (callback17ret == -1))
>          goto cleanup;
>  
>      if (virConnectSetKeepAlive(dconn, 5, 3) < 0) {

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