From 1d6fb3f2bb4c192a5662a0cd623295d92723ebe4 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Thu, 15 Dec 2011 08:02:54 +0200 Subject: [PATCH] kvm tools: Use kvm__supports_extension instead of kvm__has_cap kvm__supports_extension has been there before, and it's does it's job right unlike kvm__has_cap. Signed-off-by: Sasha Levin Signed-off-by: Pekka Enberg --- include/kvm/kvm.h | 1 + ioeventfd.c | 2 +- kvm.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/kvm/kvm.h b/include/kvm/kvm.h index 35bb400..7996dfd 100644 --- a/include/kvm/kvm.h +++ b/include/kvm/kvm.h @@ -82,5 +82,6 @@ static inline void *guest_flat_to_host(struct kvm *kvm, unsigned long offset) } bool kvm__has_cap(struct kvm *kvm, u32 cap); +bool kvm__supports_extension(struct kvm *kvm, unsigned int extension); #endif /* KVM__KVM_H */ diff --git a/ioeventfd.c b/ioeventfd.c index 75dd3f2..1d6a7ac 100644 --- a/ioeventfd.c +++ b/ioeventfd.c @@ -22,7 +22,7 @@ static bool ioeventfd_avail; void ioeventfd__init(struct kvm *kvm) { - ioeventfd_avail = kvm__has_cap(kvm, KVM_CAP_IOEVENTFD); + ioeventfd_avail = kvm__supports_extension(kvm, KVM_CAP_IOEVENTFD); if (!ioeventfd_avail) return; diff --git a/kvm.c b/kvm.c index d5cbf57..008170a 100644 --- a/kvm.c +++ b/kvm.c @@ -90,7 +90,7 @@ const char *kvm__get_dir(void) return kvm_dir; } -static bool kvm__supports_extension(struct kvm *kvm, unsigned int extension) +bool kvm__supports_extension(struct kvm *kvm, unsigned int extension) { int ret;