aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/eventfd.c
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2013-02-28 06:33:18 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2013-03-05 17:12:16 -0500
commita0f155e9646d5f1c263f6f9aae880151100243bb (patch)
tree761de60204c9c0a5c2208775295c6baa9e5693fb /virt/kvm/eventfd.c
parent6a773cb825afb74a600a08fe87fab55ee98ec2ac (diff)
KVM: Initialize irqfd from kvm_init().
Currently, eventfd introduces module_init/module_exit functions to initialize/cleanup the irqfd workqueue. This only works, however, if no other module_init/module_exit functions are built into the same module. Let's just move the initialization and cleanup to kvm_init and kvm_exit. This way, it is also clearer where kvm startup may fail. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/eventfd.c')
-rw-r--r--virt/kvm/eventfd.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index adb17f266b28..0b6fe69bb03d 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -543,7 +543,7 @@ void kvm_irq_routing_update(struct kvm *kvm,
543 * aggregated from all vm* instances. We need our own isolated single-thread 543 * aggregated from all vm* instances. We need our own isolated single-thread
544 * queue to prevent deadlock against flushing the normal work-queue. 544 * queue to prevent deadlock against flushing the normal work-queue.
545 */ 545 */
546static int __init irqfd_module_init(void) 546int kvm_irqfd_init(void)
547{ 547{
548 irqfd_cleanup_wq = create_singlethread_workqueue("kvm-irqfd-cleanup"); 548 irqfd_cleanup_wq = create_singlethread_workqueue("kvm-irqfd-cleanup");
549 if (!irqfd_cleanup_wq) 549 if (!irqfd_cleanup_wq)
@@ -552,13 +552,10 @@ static int __init irqfd_module_init(void)
552 return 0; 552 return 0;
553} 553}
554 554
555static void __exit irqfd_module_exit(void) 555void kvm_irqfd_exit(void)
556{ 556{
557 destroy_workqueue(irqfd_cleanup_wq); 557 destroy_workqueue(irqfd_cleanup_wq);
558} 558}
559
560module_init(irqfd_module_init);
561module_exit(irqfd_module_exit);
562#endif 559#endif
563 560
564/* 561/*