kvm tools: Use kvm__supports_extension instead of kvm__has_cap
PATCH 1/2 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 <[email protected]>
--- tools/kvm/include/kvm/kvm.h | 1 + tools/kvm/ioeventfd.c | 2 +- tools/kvm/kvm.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)
tools/kvm/include/kvm/kvm.h +1 -0
@@ -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 */
tools/kvm/ioeventfd.c +1 -1
@@ -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 ;
tools/kvm/kvm.c +1 -1
@@ -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;
Signature · 1 line
1.7.8
PATCH 2/2 Revert "kvm tools: Add kvm__has_cap() to check whether a cap is available on the host"
We already had kvm__has_extension, no need for two functions that do the same.
This reverts commit 42efb1abf4ebebeedd14af34c073e673923e2898.
Conflicts:
tools/kvm/include/kvm/kvm.h
Signed-off-by Sasha Levin <[email protected]>
--- tools/kvm/include/kvm/kvm.h | 1 - tools/kvm/kvm.c | 5 ----- 2 files changed, 0 insertions(+), 6 deletions(-)
tools/kvm/include/kvm/kvm.h +0 -1
@@ -81,7 +81,6 @@ static inline void *guest_flat_to_host(struct kvm *kvm, unsigned long offset) return kvm->ram_start + offset; } -bool kvm__has_cap (struct kvm *kvm,u32 cap);bool kvm__supports_extension (struct kvm *kvm,unsigned int extension);#endif /* KVM__KVM_H */
tools/kvm/kvm.c +0 -5
@@ -520,8 +520,3 @@ void kvm__notify_paused(void)mutex_lock (&pause_lock);mutex_unlock (&pause_lock); } - -bool kvm__has_cap (struct kvm *kvm,u32 cap) -{ -return ioctl (kvm->sys_fd,KVM_CHECK_EXTENSION , cap) ==0 ; -}
Signature · 1 line
1.7.8