From: Sasha Levin Subject: [PATCH 1/2] kvm tools: Use kvm__supports_extension instead of kvm__has_cap Date: Thu, 15 Dec 2011 08:02:54 +0200 Message-ID: <1323928975-4863-1-git-send-email-levinsasha928@gmail.com> Cc: mingo@elte.hu, gorcunov@gmail.com, asias.hejun@gmail.com, kvm@vger.kernel.org, matt@ozlabs.org, Sasha Levin To: penberg@kernel.org Return-path: Received: from mail-ee0-f46.google.com ([74.125.83.46]:52227 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752698Ab1LOGDJ (ORCPT ); Thu, 15 Dec 2011 01:03:09 -0500 Received: by eekc4 with SMTP id c4so1701739eek.19 for ; Wed, 14 Dec 2011 22:03:07 -0800 (PST) Sender: kvm-owner@vger.kernel.org List-ID: kvm__supports_extension has been there before, and it's does it's job right unlike kvm__has_cap. Signed-off-by: Sasha Levin --- tools/kvm/include/kvm/kvm.h | 1 + tools/kvm/ioeventfd.c | 2 +- tools/kvm/kvm.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/kvm/include/kvm/kvm.h b/tools/kvm/include/kvm/kvm.h index 35bb400..7996dfd 100644 --- a/tools/kvm/include/kvm/kvm.h +++ b/tools/kvm/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/tools/kvm/ioeventfd.c b/tools/kvm/ioeventfd.c index 75dd3f2..1d6a7ac 100644 --- a/tools/kvm/ioeventfd.c +++ b/tools/kvm/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/tools/kvm/kvm.c b/tools/kvm/kvm.c index 9583ab2..24b8a60 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm/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; -- 1.7.8