[libvirt] [dbus PATCH 3/4] events: Rename all lifecycle event functions to follow the signal name

Pavel Hrdina posted 4 patches 6 years, 12 months ago
There is a newer version of this series
[libvirt] [dbus PATCH 3/4] events: Rename all lifecycle event functions to follow the signal name
Posted by Pavel Hrdina 6 years, 12 months ago
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 src/events.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/events.c b/src/events.c
index deda9cc..6cc2164 100644
--- a/src/events.c
+++ b/src/events.c
@@ -96,11 +96,11 @@ virtDBusEventsDomainControlError(virConnectPtr connection G_GNUC_UNUSED,
 }
 
 static gint
-virtDBusEventsDomainLifecycle(virConnectPtr connection G_GNUC_UNUSED,
-                              virDomainPtr domain,
-                              gint event,
-                              gint detail,
-                              gpointer opaque)
+virtDBusEventsDomainEvent(virConnectPtr connection G_GNUC_UNUSED,
+                          virDomainPtr domain,
+                          gint event,
+                          gint detail,
+                          gpointer opaque)
 {
     virtDBusConnect *connect = opaque;
     g_autofree gchar *path = NULL;
@@ -545,7 +545,7 @@ virtDBusEventsDomainDiskChange(virConnectPtr connection G_GNUC_UNUSED,
 }
 
 static gint
-virtDBusEventsNetworkLifecycle(virConnectPtr connection G_GNUC_UNUSED,
+virtDBusEventsNetworkEvent(virConnectPtr connection G_GNUC_UNUSED,
                                virNetworkPtr network,
                                gint event,
                                gint detail G_GNUC_UNUSED,
@@ -568,7 +568,7 @@ virtDBusEventsNetworkLifecycle(virConnectPtr connection G_GNUC_UNUSED,
 }
 
 static gint
-virtDBusEventsSecretLifecycle(virConnectPtr connection G_GNUC_UNUSED,
+virtDBusEventsSecretEvent(virConnectPtr connection G_GNUC_UNUSED,
                               virSecretPtr secret,
                               gint event,
                               gint detail,
@@ -591,7 +591,7 @@ virtDBusEventsSecretLifecycle(virConnectPtr connection G_GNUC_UNUSED,
 }
 
 static gint
-virtDBusEventsStoragePoolLifecycle(virConnectPtr connection G_GNUC_UNUSED,
+virtDBusEventsStoragePoolEvent(virConnectPtr connection G_GNUC_UNUSED,
                                    virStoragePoolPtr storagePool,
                                    gint event,
                                    gint detail,
@@ -701,7 +701,7 @@ virtDBusEventsRegister(virtDBusConnect *connect)
 {
     virtDBusEventsRegisterDomainEvent(connect,
                                       VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE,
-                                      VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainAgentLifecycle));
+                                      VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainAgentEvent));
 
     virtDBusEventsRegisterDomainEvent(connect,
                                       VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE,
@@ -717,7 +717,7 @@ virtDBusEventsRegister(virtDBusConnect *connect)
 
     virtDBusEventsRegisterDomainEvent(connect,
                                       VIR_DOMAIN_EVENT_ID_LIFECYCLE,
-                                      VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainLifecycle));
+                                      VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainEvent));
 
     virtDBusEventsRegisterDomainEvent(connect,
                                       VIR_DOMAIN_EVENT_ID_DEVICE_ADDED,
@@ -741,7 +741,7 @@ virtDBusEventsRegister(virtDBusConnect *connect)
 
     virtDBusEventsRegisterDomainEvent(connect,
                                       VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON,
-                                      VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainIOErrorReason));
+                                      VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainIOError));
 
     virtDBusEventsRegisterDomainEvent(connect,
                                       VIR_DOMAIN_EVENT_ID_JOB_COMPLETED,
@@ -789,15 +789,15 @@ virtDBusEventsRegister(virtDBusConnect *connect)
 
     virtDBusEventsRegisterNetworkEvent(connect,
                                        VIR_NETWORK_EVENT_ID_LIFECYCLE,
-                                       VIR_NETWORK_EVENT_CALLBACK(virtDBusEventsNetworkLifecycle));
+                                       VIR_NETWORK_EVENT_CALLBACK(virtDBusEventsNetworkEvent));
 
     virtDBusEventsRegisterSecretEvent(connect,
                                       VIR_SECRET_EVENT_ID_LIFECYCLE,
-                                      VIR_SECRET_EVENT_CALLBACK(virtDBusEventsSecretLifecycle));
+                                      VIR_SECRET_EVENT_CALLBACK(virtDBusEventsSecretEvent));
 
     virtDBusEventsRegisterStoragePoolEvent(connect,
                                            VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE,
-                                           VIR_STORAGE_POOL_EVENT_CALLBACK(virtDBusEventsStoragePoolLifecycle));
+                                           VIR_STORAGE_POOL_EVENT_CALLBACK(virtDBusEventsStoragePoolEvent));
 
     virtDBusEventsRegisterStoragePoolEvent(connect,
                                            VIR_STORAGE_POOL_EVENT_ID_REFRESH,
-- 
2.17.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [dbus PATCH 3/4] events: Rename all lifecycle event functions to follow the signal name
Posted by kkoukiou@redhat.com 6 years, 12 months ago
On Tue, 2018-05-15 at 15:35 +0200, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---
>  src/events.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/src/events.c b/src/events.c
> index deda9cc..6cc2164 100644
> --- a/src/events.c
> +++ b/src/events.c
> @@ -96,11 +96,11 @@ virtDBusEventsDomainControlError(virConnectPtr
> connection G_GNUC_UNUSED,
>  }
>  
>  static gint
> -virtDBusEventsDomainLifecycle(virConnectPtr connection
> G_GNUC_UNUSED,
> -                              virDomainPtr domain,
> -                              gint event,
> -                              gint detail,
> -                              gpointer opaque)
> +virtDBusEventsDomainEvent(virConnectPtr connection G_GNUC_UNUSED,
> +                          virDomainPtr domain,
> +                          gint event,
> +                          gint detail,
> +                          gpointer opaque)
>  {
>      virtDBusConnect *connect = opaque;
>      g_autofree gchar *path = NULL;
> @@ -545,7 +545,7 @@ virtDBusEventsDomainDiskChange(virConnectPtr
> connection G_GNUC_UNUSED,
>  }
>  
>  static gint
> -virtDBusEventsNetworkLifecycle(virConnectPtr connection
> G_GNUC_UNUSED,
> +virtDBusEventsNetworkEvent(virConnectPtr connection G_GNUC_UNUSED,
>                                 virNetworkPtr network,
>                                 gint event,
>                                 gint detail G_GNUC_UNUSED,
> @@ -568,7 +568,7 @@ virtDBusEventsNetworkLifecycle(virConnectPtr
> connection G_GNUC_UNUSED,
>  }
>  
>  static gint
> -virtDBusEventsSecretLifecycle(virConnectPtr connection
> G_GNUC_UNUSED,
> +virtDBusEventsSecretEvent(virConnectPtr connection G_GNUC_UNUSED,
>                                virSecretPtr secret,
>                                gint event,
>                                gint detail,
> @@ -591,7 +591,7 @@ virtDBusEventsSecretLifecycle(virConnectPtr
> connection G_GNUC_UNUSED,
>  }
>  
>  static gint
> -virtDBusEventsStoragePoolLifecycle(virConnectPtr connection
> G_GNUC_UNUSED,
> +virtDBusEventsStoragePoolEvent(virConnectPtr connection
> G_GNUC_UNUSED,
>                                     virStoragePoolPtr storagePool,
>                                     gint event,
>                                     gint detail,
> @@ -701,7 +701,7 @@ virtDBusEventsRegister(virtDBusConnect *connect)
>  {
>      virtDBusEventsRegisterDomainEvent(connect,
>                                        VIR_DOMAIN_EVENT_ID_AGENT_LIFE
> CYCLE,
> -                                      VIR_DOMAIN_EVENT_CALLBACK(virt
> DBusEventsDomainAgentLifecycle));
> +                                      VIR_DOMAIN_EVENT_CALLBACK(virt
> DBusEventsDomainAgentEvent));
>  
>      virtDBusEventsRegisterDomainEvent(connect,
>                                        VIR_DOMAIN_EVENT_ID_BALLOON_CH
> ANGE,
> @@ -717,7 +717,7 @@ virtDBusEventsRegister(virtDBusConnect *connect)
>  
>      virtDBusEventsRegisterDomainEvent(connect,
>                                        VIR_DOMAIN_EVENT_ID_LIFECYCLE,
> -                                      VIR_DOMAIN_EVENT_CALLBACK(virt
> DBusEventsDomainLifecycle));
> +                                      VIR_DOMAIN_EVENT_CALLBACK(virt
> DBusEventsDomainEvent));
>  
>      virtDBusEventsRegisterDomainEvent(connect,
>                                        VIR_DOMAIN_EVENT_ID_DEVICE_ADD
> ED,
> @@ -741,7 +741,7 @@ virtDBusEventsRegister(virtDBusConnect *connect)
>  
>      virtDBusEventsRegisterDomainEvent(connect,
>                                        VIR_DOMAIN_EVENT_ID_IO_ERROR_R
> EASON,
> -                                      VIR_DOMAIN_EVENT_CALLBACK(virt
> DBusEventsDomainIOErrorReason));
> +                                      VIR_DOMAIN_EVENT_CALLBACK(virt
> DBusEventsDomainIOError));

This should be done in the next patch since function definition was not
changed.

Katerina

>  
>      virtDBusEventsRegisterDomainEvent(connect,
>                                        VIR_DOMAIN_EVENT_ID_JOB_COMPLE
> TED,
> @@ -789,15 +789,15 @@ virtDBusEventsRegister(virtDBusConnect
> *connect)
>  
>      virtDBusEventsRegisterNetworkEvent(connect,
>                                         VIR_NETWORK_EVENT_ID_LIFECYCL
> E,
> -                                       VIR_NETWORK_EVENT_CALLBACK(vi
> rtDBusEventsNetworkLifecycle));
> +                                       VIR_NETWORK_EVENT_CALLBACK(vi
> rtDBusEventsNetworkEvent));
>  
>      virtDBusEventsRegisterSecretEvent(connect,
>                                        VIR_SECRET_EVENT_ID_LIFECYCLE,
> -                                      VIR_SECRET_EVENT_CALLBACK(virt
> DBusEventsSecretLifecycle));
> +                                      VIR_SECRET_EVENT_CALLBACK(virt
> DBusEventsSecretEvent));
>  
>      virtDBusEventsRegisterStoragePoolEvent(connect,
>                                             VIR_STORAGE_POOL_EVENT_ID
> _LIFECYCLE,
> -                                           VIR_STORAGE_POOL_EVENT_CA
> LLBACK(virtDBusEventsStoragePoolLifecycle));
> +                                           VIR_STORAGE_POOL_EVENT_CA
> LLBACK(virtDBusEventsStoragePoolEvent));
>  
>      virtDBusEventsRegisterStoragePoolEvent(connect,
>                                             VIR_STORAGE_POOL_EVENT_ID
> _REFRESH,

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [dbus PATCH 3/4] events: Rename all lifecycle event functions to follow the signal name
Posted by Pavel Hrdina 6 years, 12 months ago
On Wed, May 16, 2018 at 11:20:38AM +0200, kkoukiou@redhat.com wrote:
> On Tue, 2018-05-15 at 15:35 +0200, Pavel Hrdina wrote:
> > Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> > ---
> >  src/events.c | 28 ++++++++++++++--------------
> >  1 file changed, 14 insertions(+), 14 deletions(-)
> > 
> > diff --git a/src/events.c b/src/events.c
> > index deda9cc..6cc2164 100644
> > --- a/src/events.c
> > +++ b/src/events.c
> > @@ -96,11 +96,11 @@ virtDBusEventsDomainControlError(virConnectPtr
> > connection G_GNUC_UNUSED,
> >  }
> >  
> >  static gint
> > -virtDBusEventsDomainLifecycle(virConnectPtr connection
> > G_GNUC_UNUSED,
> > -                              virDomainPtr domain,
> > -                              gint event,
> > -                              gint detail,
> > -                              gpointer opaque)
> > +virtDBusEventsDomainEvent(virConnectPtr connection G_GNUC_UNUSED,
> > +                          virDomainPtr domain,
> > +                          gint event,
> > +                          gint detail,
> > +                          gpointer opaque)
> >  {
> >      virtDBusConnect *connect = opaque;
> >      g_autofree gchar *path = NULL;
> > @@ -545,7 +545,7 @@ virtDBusEventsDomainDiskChange(virConnectPtr
> > connection G_GNUC_UNUSED,
> >  }
> >  
> >  static gint
> > -virtDBusEventsNetworkLifecycle(virConnectPtr connection
> > G_GNUC_UNUSED,
> > +virtDBusEventsNetworkEvent(virConnectPtr connection G_GNUC_UNUSED,
> >                                 virNetworkPtr network,
> >                                 gint event,
> >                                 gint detail G_GNUC_UNUSED,
> > @@ -568,7 +568,7 @@ virtDBusEventsNetworkLifecycle(virConnectPtr
> > connection G_GNUC_UNUSED,
> >  }
> >  
> >  static gint
> > -virtDBusEventsSecretLifecycle(virConnectPtr connection
> > G_GNUC_UNUSED,
> > +virtDBusEventsSecretEvent(virConnectPtr connection G_GNUC_UNUSED,
> >                                virSecretPtr secret,
> >                                gint event,
> >                                gint detail,
> > @@ -591,7 +591,7 @@ virtDBusEventsSecretLifecycle(virConnectPtr
> > connection G_GNUC_UNUSED,
> >  }
> >  
> >  static gint
> > -virtDBusEventsStoragePoolLifecycle(virConnectPtr connection
> > G_GNUC_UNUSED,
> > +virtDBusEventsStoragePoolEvent(virConnectPtr connection
> > G_GNUC_UNUSED,
> >                                     virStoragePoolPtr storagePool,
> >                                     gint event,
> >                                     gint detail,
> > @@ -701,7 +701,7 @@ virtDBusEventsRegister(virtDBusConnect *connect)
> >  {
> >      virtDBusEventsRegisterDomainEvent(connect,
> >                                        VIR_DOMAIN_EVENT_ID_AGENT_LIFE
> > CYCLE,
> > -                                      VIR_DOMAIN_EVENT_CALLBACK(virt
> > DBusEventsDomainAgentLifecycle));
> > +                                      VIR_DOMAIN_EVENT_CALLBACK(virt
> > DBusEventsDomainAgentEvent));
> >  
> >      virtDBusEventsRegisterDomainEvent(connect,
> >                                        VIR_DOMAIN_EVENT_ID_BALLOON_CH
> > ANGE,
> > @@ -717,7 +717,7 @@ virtDBusEventsRegister(virtDBusConnect *connect)
> >  
> >      virtDBusEventsRegisterDomainEvent(connect,
> >                                        VIR_DOMAIN_EVENT_ID_LIFECYCLE,
> > -                                      VIR_DOMAIN_EVENT_CALLBACK(virt
> > DBusEventsDomainLifecycle));
> > +                                      VIR_DOMAIN_EVENT_CALLBACK(virt
> > DBusEventsDomainEvent));
> >  
> >      virtDBusEventsRegisterDomainEvent(connect,
> >                                        VIR_DOMAIN_EVENT_ID_DEVICE_ADD
> > ED,
> > @@ -741,7 +741,7 @@ virtDBusEventsRegister(virtDBusConnect *connect)
> >  
> >      virtDBusEventsRegisterDomainEvent(connect,
> >                                        VIR_DOMAIN_EVENT_ID_IO_ERROR_R
> > EASON,
> > -                                      VIR_DOMAIN_EVENT_CALLBACK(virt
> > DBusEventsDomainIOErrorReason));
> > +                                      VIR_DOMAIN_EVENT_CALLBACK(virt
> > DBusEventsDomainIOError));
> 
> This should be done in the next patch since function definition was not
> changed.

Oh, right, nice catch.  That's what happen if you have all the changes
and then you split it into commits :).

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