[libvirt] [ [PATCH v3 3/8] virsh: Move vshEventCallback structure definition to virsh-domain.h

Michal Privoznik mprivozn at redhat.com
Thu May 24 13:31:27 UTC 2018


On 05/23/2018 08:32 AM, Lin Ma wrote:
> The next patch will use it in virsh-completer.c for returning the strings
> of domain event name.
> 
> Signed-off-by: Lin Ma <lma at suse.com>
> ---
>  tools/virsh-domain.c | 8 +-------
>  tools/virsh-domain.h | 8 ++++++++
>  2 files changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index cfbbf5a7bc..347c744bc9 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -12832,12 +12832,6 @@ virshDomainEventTrayChangeToString(int reason)
>      return str ? _(str) : _("unknown");
>  }
>  
> -struct vshEventCallback {
> -    const char *name;
> -    virConnectDomainEventGenericCallback cb;
> -};
> -typedef struct vshEventCallback vshEventCallback;
> -
>  struct virshDomEventData {
>      vshControl *ctl;
>      bool loop;
> @@ -13278,7 +13272,7 @@ virshEventBlockThresholdPrint(virConnectPtr conn ATTRIBUTE_UNUSED,
>  }
>  
>  
> -static vshEventCallback vshEventCallbacks[] = {
> +vshEventCallback vshEventCallbacks[] = {
>      { "lifecycle",
>        VIR_DOMAIN_EVENT_CALLBACK(virshEventLifecyclePrint), },
>      { "reboot", virshEventGenericPrint, },
> diff --git a/tools/virsh-domain.h b/tools/virsh-domain.h
> index 3f9d12a5ff..e8e5611244 100644
> --- a/tools/virsh-domain.h
> +++ b/tools/virsh-domain.h
> @@ -28,6 +28,14 @@
>  
>  # include "virsh.h"
>  
> +struct vshEventCallback {
> +    const char *name;
> +    virConnectDomainEventGenericCallback cb;
> +};
> +typedef struct vshEventCallback vshEventCallback;

This should be virshDomainEventCallback because:

a) it's related to virsh, not vsh
b) it's related to Domain not some generic object

Michal




More information about the libvir-list mailing list