KVM: clean up directives to compile out irqfds
Keep all #ifdef CONFIG_HAVE_KVM_IRQCHIP parts of eventfd.c together, and compile out the irqfds field of struct kvm if the symbol is not defined. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>pull/477/merge
parent
a5d3df8ae1
commit
8ed26ab8d5
|
|
@ -782,6 +782,7 @@ struct kvm {
|
||||||
struct list_head vm_list;
|
struct list_head vm_list;
|
||||||
struct mutex lock;
|
struct mutex lock;
|
||||||
struct kvm_io_bus __rcu *buses[KVM_NR_BUSES];
|
struct kvm_io_bus __rcu *buses[KVM_NR_BUSES];
|
||||||
|
#ifdef CONFIG_HAVE_KVM_IRQCHIP
|
||||||
struct {
|
struct {
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
struct list_head items;
|
struct list_head items;
|
||||||
|
|
@ -789,6 +790,7 @@ struct kvm {
|
||||||
struct list_head resampler_list;
|
struct list_head resampler_list;
|
||||||
struct mutex resampler_lock;
|
struct mutex resampler_lock;
|
||||||
} irqfds;
|
} irqfds;
|
||||||
|
#endif
|
||||||
struct list_head ioeventfds;
|
struct list_head ioeventfds;
|
||||||
struct kvm_vm_stat stat;
|
struct kvm_vm_stat stat;
|
||||||
struct kvm_arch arch;
|
struct kvm_arch arch;
|
||||||
|
|
|
||||||
|
|
@ -526,21 +526,7 @@ void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
|
||||||
synchronize_srcu(&kvm->irq_srcu);
|
synchronize_srcu(&kvm->irq_srcu);
|
||||||
kvm_arch_post_irq_ack_notifier_list_update(kvm);
|
kvm_arch_post_irq_ack_notifier_list_update(kvm);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
|
||||||
kvm_eventfd_init(struct kvm *kvm)
|
|
||||||
{
|
|
||||||
#ifdef CONFIG_HAVE_KVM_IRQCHIP
|
|
||||||
spin_lock_init(&kvm->irqfds.lock);
|
|
||||||
INIT_LIST_HEAD(&kvm->irqfds.items);
|
|
||||||
INIT_LIST_HEAD(&kvm->irqfds.resampler_list);
|
|
||||||
mutex_init(&kvm->irqfds.resampler_lock);
|
|
||||||
#endif
|
|
||||||
INIT_LIST_HEAD(&kvm->ioeventfds);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_HAVE_KVM_IRQCHIP
|
|
||||||
/*
|
/*
|
||||||
* shutdown any irqfd's that match fd+gsi
|
* shutdown any irqfd's that match fd+gsi
|
||||||
*/
|
*/
|
||||||
|
|
@ -1012,3 +998,15 @@ kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
|
||||||
|
|
||||||
return kvm_assign_ioeventfd(kvm, args);
|
return kvm_assign_ioeventfd(kvm, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
kvm_eventfd_init(struct kvm *kvm)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_HAVE_KVM_IRQCHIP
|
||||||
|
spin_lock_init(&kvm->irqfds.lock);
|
||||||
|
INIT_LIST_HEAD(&kvm->irqfds.items);
|
||||||
|
INIT_LIST_HEAD(&kvm->irqfds.resampler_list);
|
||||||
|
mutex_init(&kvm->irqfds.resampler_lock);
|
||||||
|
#endif
|
||||||
|
INIT_LIST_HEAD(&kvm->ioeventfds);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue