Message ID | 20250307180337.14811-9-philmd@linaro.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | hw/vfio: Build various objects once | expand |
On 3/7/25 10:03, 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, and > implement their stub. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > include/system/kvm.h | 8 ++++---- > accel/stubs/kvm-stub.c | 12 ++++++++++++ > 2 files changed, 16 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, > diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c > index ecfd7636f5f..a305b33d84d 100644 > --- a/accel/stubs/kvm-stub.c > +++ b/accel/stubs/kvm-stub.c > @@ -83,6 +83,18 @@ void kvm_irqchip_change_notify(void) > { > } > > +int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n, > + EventNotifier *rn, qemu_irq irq) > +{ > + return -ENOSYS; > +} > + > +int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, > + qemu_irq irq) > +{ > + return -ENOSYS; > +} > + > int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n, > EventNotifier *rn, int virq) > { Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
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, diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c index ecfd7636f5f..a305b33d84d 100644 --- a/accel/stubs/kvm-stub.c +++ b/accel/stubs/kvm-stub.c @@ -83,6 +83,18 @@ void kvm_irqchip_change_notify(void) { } +int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n, + EventNotifier *rn, qemu_irq irq) +{ + return -ENOSYS; +} + +int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, + qemu_irq irq) +{ + return -ENOSYS; +} + int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n, EventNotifier *rn, int virq) {
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, and implement their stub. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- include/system/kvm.h | 8 ++++---- accel/stubs/kvm-stub.c | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-)