On 3/9/25 12:09 AM, Philippe Mathieu-Daudé wrote:
> Currently kvm_irqchip_add_irqfd_notifier() and
> kvm_irqchip_remove_irqfd_notifier() are only declared on
> target specific code. There is not particular reason to,
> as their prototypes don't use anything target related.
>
> Move their declaration with common prototypes, otherwise
> the next commit would trigger:
>
>   hw/vfio/pci.c: In function ‘vfio_realize’:
>   hw/vfio/pci.c:3178:9: error: implicit declaration of function 
> ‘kvm_irqchip_add_change_notifier’
>    3178 |         
> kvm_irqchip_add_change_notifier(&vdev->irqchip_change_notifier);
>         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>         |         kvm_irqchip_add_irqfd_notifier
>   hw/vfio/pci.c:3236:9: error: implicit declaration of function 
> ‘kvm_irqchip_remove_change_notifier’
>    3236 |         
> kvm_irqchip_remove_change_notifier(&vdev->irqchip_change_notifier);
>         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>         |         kvm_irqchip_remove_irqfd_notifier
>
> Reviewed-by: Pierrick Bouvier <pierrick.bouv...@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Reviewed-by: Eric Auger <eric.au...@redhat.com>

Eric
> ---
>  include/system/kvm.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/system/kvm.h b/include/system/kvm.h
> index ab17c09a551..75673fb794e 100644
> --- a/include/system/kvm.h
> +++ b/include/system/kvm.h
> @@ -412,10 +412,6 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg);
>  
>  void kvm_irqchip_add_irq_route(KVMState *s, int gsi, int irqchip, int pin);
>  
> -void kvm_irqchip_add_change_notifier(Notifier *n);
> -void kvm_irqchip_remove_change_notifier(Notifier *n);
> -void kvm_irqchip_change_notify(void);
> -
>  struct kvm_guest_debug;
>  struct kvm_debug_exit_arch;
>  
> @@ -517,6 +513,10 @@ void kvm_irqchip_release_virq(KVMState *s, int virq);
>  void kvm_add_routing_entry(KVMState *s,
>                             struct kvm_irq_routing_entry *entry);
>  
> +void kvm_irqchip_add_change_notifier(Notifier *n);
> +void kvm_irqchip_remove_change_notifier(Notifier *n);
> +void kvm_irqchip_change_notify(void);
> +
>  int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
>                                         EventNotifier *rn, int virq);
>  int kvm_irqchip_remove_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,


Reply via email to