kvm: rename kvm_irqchip_[add,remove]_irqfd_notifier with gsi suffix

Anticipating for the introduction of new add/remove functions taking
a qemu_irq parameter, let's rename existing ones with a gsi suffix.

Signed-off-by: Eric Auger <eric.auger@linaro.org>
Tested-by: Vikram Sethi <vikrams@codeaurora.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
Eric Auger 2015-07-06 12:15:13 -06:00 committed by Alex Williamson
parent f7ceed190d
commit 1c9b71a731
6 changed files with 21 additions and 18 deletions

View File

@ -1316,8 +1316,8 @@ static int virtio_ccw_add_irqfd(VirtioCcwDevice *dev, int n)
VirtQueue *vq = virtio_get_queue(vdev, n); VirtQueue *vq = virtio_get_queue(vdev, n);
EventNotifier *notifier = virtio_queue_get_guest_notifier(vq); EventNotifier *notifier = virtio_queue_get_guest_notifier(vq);
return kvm_irqchip_add_irqfd_notifier(kvm_state, notifier, NULL, return kvm_irqchip_add_irqfd_notifier_gsi(kvm_state, notifier, NULL,
dev->routes.gsi[n]); dev->routes.gsi[n]);
} }
static void virtio_ccw_remove_irqfd(VirtioCcwDevice *dev, int n) static void virtio_ccw_remove_irqfd(VirtioCcwDevice *dev, int n)
@ -1327,8 +1327,8 @@ static void virtio_ccw_remove_irqfd(VirtioCcwDevice *dev, int n)
EventNotifier *notifier = virtio_queue_get_guest_notifier(vq); EventNotifier *notifier = virtio_queue_get_guest_notifier(vq);
int ret; int ret;
ret = kvm_irqchip_remove_irqfd_notifier(kvm_state, notifier, ret = kvm_irqchip_remove_irqfd_notifier_gsi(kvm_state, notifier,
dev->routes.gsi[n]); dev->routes.gsi[n]);
assert(ret == 0); assert(ret == 0);
} }

View File

@ -597,7 +597,7 @@ static void vfio_add_kvm_msi_virq(VFIOMSIVector *vector, MSIMessage *msg,
return; return;
} }
if (kvm_irqchip_add_irqfd_notifier(kvm_state, &vector->kvm_interrupt, if (kvm_irqchip_add_irqfd_notifier_gsi(kvm_state, &vector->kvm_interrupt,
NULL, virq) < 0) { NULL, virq) < 0) {
kvm_irqchip_release_virq(kvm_state, virq); kvm_irqchip_release_virq(kvm_state, virq);
event_notifier_cleanup(&vector->kvm_interrupt); event_notifier_cleanup(&vector->kvm_interrupt);
@ -609,8 +609,8 @@ static void vfio_add_kvm_msi_virq(VFIOMSIVector *vector, MSIMessage *msg,
static void vfio_remove_kvm_msi_virq(VFIOMSIVector *vector) static void vfio_remove_kvm_msi_virq(VFIOMSIVector *vector)
{ {
kvm_irqchip_remove_irqfd_notifier(kvm_state, &vector->kvm_interrupt, kvm_irqchip_remove_irqfd_notifier_gsi(kvm_state, &vector->kvm_interrupt,
vector->virq); vector->virq);
kvm_irqchip_release_virq(kvm_state, vector->virq); kvm_irqchip_release_virq(kvm_state, vector->virq);
vector->virq = -1; vector->virq = -1;
event_notifier_cleanup(&vector->kvm_interrupt); event_notifier_cleanup(&vector->kvm_interrupt);

View File

@ -495,7 +495,7 @@ static int kvm_virtio_pci_irqfd_use(VirtIOPCIProxy *proxy,
VirtQueue *vq = virtio_get_queue(vdev, queue_no); VirtQueue *vq = virtio_get_queue(vdev, queue_no);
EventNotifier *n = virtio_queue_get_guest_notifier(vq); EventNotifier *n = virtio_queue_get_guest_notifier(vq);
int ret; int ret;
ret = kvm_irqchip_add_irqfd_notifier(kvm_state, n, NULL, irqfd->virq); ret = kvm_irqchip_add_irqfd_notifier_gsi(kvm_state, n, NULL, irqfd->virq);
return ret; return ret;
} }
@ -509,7 +509,7 @@ static void kvm_virtio_pci_irqfd_release(VirtIOPCIProxy *proxy,
VirtIOIRQFD *irqfd = &proxy->vector_irqfd[vector]; VirtIOIRQFD *irqfd = &proxy->vector_irqfd[vector];
int ret; int ret;
ret = kvm_irqchip_remove_irqfd_notifier(kvm_state, n, irqfd->virq); ret = kvm_irqchip_remove_irqfd_notifier_gsi(kvm_state, n, irqfd->virq);
assert(ret == 0); assert(ret == 0);
} }

View File

@ -416,9 +416,10 @@ void kvm_irqchip_release_virq(KVMState *s, int virq);
int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter); int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter);
int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n, int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
EventNotifier *rn, int virq); EventNotifier *rn, int virq);
int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, int virq); int kvm_irqchip_remove_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
int virq);
void kvm_pc_gsi_handler(void *opaque, int n, int level); void kvm_pc_gsi_handler(void *opaque, int n, int level);
void kvm_pc_setup_irq_routing(bool pci_enabled); void kvm_pc_setup_irq_routing(bool pci_enabled);
void kvm_init_irq_routing(KVMState *s); void kvm_init_irq_routing(KVMState *s);

View File

@ -1328,14 +1328,15 @@ int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg)
} }
#endif /* !KVM_CAP_IRQ_ROUTING */ #endif /* !KVM_CAP_IRQ_ROUTING */
int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n, int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
EventNotifier *rn, int virq) EventNotifier *rn, int virq)
{ {
return kvm_irqchip_assign_irqfd(s, event_notifier_get_fd(n), return kvm_irqchip_assign_irqfd(s, event_notifier_get_fd(n),
rn ? event_notifier_get_fd(rn) : -1, virq, true); rn ? event_notifier_get_fd(rn) : -1, virq, true);
} }
int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, int virq) int kvm_irqchip_remove_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
int virq)
{ {
return kvm_irqchip_assign_irqfd(s, event_notifier_get_fd(n), -1, virq, return kvm_irqchip_assign_irqfd(s, event_notifier_get_fd(n), -1, virq,
false); false);

View File

@ -137,13 +137,14 @@ int kvm_irqchip_add_adapter_route(KVMState *s, AdapterInfo *adapter)
return -ENOSYS; return -ENOSYS;
} }
int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n, int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
EventNotifier *rn, int virq) EventNotifier *rn, int virq)
{ {
return -ENOSYS; return -ENOSYS;
} }
int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, int virq) int kvm_irqchip_remove_irqfd_notifier_gsi(KVMState *s, EventNotifier *n,
int virq)
{ {
return -ENOSYS; return -ENOSYS;
} }