diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2014-08-29 08:01:17 -0400 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-08-29 10:35:53 -0400 |
| commit | 656473003bc7e056c3bbd4a4d9832dad01e86f76 (patch) | |
| tree | bc703dbf33c098a13c028aad2a99d9fba2a21643 /include/linux | |
| parent | d5b77069701600b8189d3b4409b69f23ac4f5bc2 (diff) | |
KVM: forward declare structs in kvm_types.h
Opaque KVM structs are useful for prototypes in asm/kvm_host.h, to avoid
"'struct foo' declared inside parameter list" warnings (and consequent
breakage due to conflicting types).
Move them from individual files to a generic place in linux/kvm_types.h.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/kvm_host.h | 6 | ||||
| -rw-r--r-- | include/linux/kvm_types.h | 14 |
2 files changed, 14 insertions, 6 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index ebd723676633..e1cb915a1096 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -140,8 +140,6 @@ static inline bool is_error_page(struct page *page) | |||
| 140 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 140 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
| 141 | #define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 | 141 | #define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 |
| 142 | 142 | ||
| 143 | struct kvm; | ||
| 144 | struct kvm_vcpu; | ||
| 145 | extern struct kmem_cache *kvm_vcpu_cache; | 143 | extern struct kmem_cache *kvm_vcpu_cache; |
| 146 | 144 | ||
| 147 | extern spinlock_t kvm_lock; | 145 | extern spinlock_t kvm_lock; |
| @@ -325,8 +323,6 @@ struct kvm_kernel_irq_routing_entry { | |||
| 325 | struct hlist_node link; | 323 | struct hlist_node link; |
| 326 | }; | 324 | }; |
| 327 | 325 | ||
| 328 | struct kvm_irq_routing_table; | ||
| 329 | |||
| 330 | #ifndef KVM_PRIVATE_MEM_SLOTS | 326 | #ifndef KVM_PRIVATE_MEM_SLOTS |
| 331 | #define KVM_PRIVATE_MEM_SLOTS 0 | 327 | #define KVM_PRIVATE_MEM_SLOTS 0 |
| 332 | #endif | 328 | #endif |
| @@ -1036,8 +1032,6 @@ static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu) | |||
| 1036 | 1032 | ||
| 1037 | extern bool kvm_rebooting; | 1033 | extern bool kvm_rebooting; |
| 1038 | 1034 | ||
| 1039 | struct kvm_device_ops; | ||
| 1040 | |||
| 1041 | struct kvm_device { | 1035 | struct kvm_device { |
| 1042 | struct kvm_device_ops *ops; | 1036 | struct kvm_device_ops *ops; |
| 1043 | struct kvm *kvm; | 1037 | struct kvm *kvm; |
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h index b0bcce0ddc95..b606bb689a3e 100644 --- a/include/linux/kvm_types.h +++ b/include/linux/kvm_types.h | |||
| @@ -17,6 +17,20 @@ | |||
| 17 | #ifndef __KVM_TYPES_H__ | 17 | #ifndef __KVM_TYPES_H__ |
| 18 | #define __KVM_TYPES_H__ | 18 | #define __KVM_TYPES_H__ |
| 19 | 19 | ||
| 20 | struct kvm; | ||
| 21 | struct kvm_async_pf; | ||
| 22 | struct kvm_device_ops; | ||
| 23 | struct kvm_interrupt; | ||
| 24 | struct kvm_irq_routing_table; | ||
| 25 | struct kvm_memory_slot; | ||
| 26 | struct kvm_one_reg; | ||
| 27 | struct kvm_run; | ||
| 28 | struct kvm_userspace_memory_region; | ||
| 29 | struct kvm_vcpu; | ||
| 30 | struct kvm_vcpu_init; | ||
| 31 | |||
| 32 | enum kvm_mr_change; | ||
| 33 | |||
| 20 | #include <asm/types.h> | 34 | #include <asm/types.h> |
| 21 | 35 | ||
| 22 | /* | 36 | /* |
