aboutsummaryrefslogtreecommitdiff
path: root/kvm.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2010-04-19 18:59:30 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-04-19 18:59:30 +0000
commit98c8573eb37bf5d7bb0c07225985a78537c73101 (patch)
treec709ea4646f51f34804bbf8de7dc1245254334b2 /kvm.h
parentc66b5c2cb6bf5ab9869bf0739ff3cdf143ab778c (diff)
provide a stub version of kvm-all.c if !CONFIG_KVM
This allows limited use of kvm functions (which will return ENOSYS) even in once-compiled modules. The patch also improves a bit the error messages for KVM initialization. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> [blauwirbel@gmail.com: fixed Win32 build] Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'kvm.h')
-rw-r--r--kvm.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/kvm.h b/kvm.h
index b90c67a498..ae87d85f24 100644
--- a/kvm.h
+++ b/kvm.h
@@ -23,8 +23,9 @@
#include <linux/kvm.h>
#endif
-#ifdef CONFIG_KVM
extern int kvm_allowed;
+
+#if defined CONFIG_KVM || !defined NEED_CPU_H
#define kvm_enabled() (kvm_allowed)
#else
#define kvm_enabled() (0)
@@ -167,15 +168,7 @@ static inline void cpu_synchronize_post_init(CPUState *env)
}
}
-#if defined(KVM_IOEVENTFD) && defined(CONFIG_KVM)
-int kvm_set_ioeventfd_pio_word(int fd, uint16_t adr, uint16_t val, bool assign);
-#else
-static inline
-int kvm_set_ioeventfd_pio_word(int fd, uint16_t adr, uint16_t val, bool assign)
-{
- return -ENOSYS;
-}
#endif
-#endif
+int kvm_set_ioeventfd_pio_word(int fd, uint16_t adr, uint16_t val, bool assign);
#endif