All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: selftests: Fix kvm_check_cap() assertion
@ 2021-06-15 15:04 Fuad Tabba
  2021-06-17 17:07 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Fuad Tabba @ 2021-06-15 15:04 UTC (permalink / raw)
  To: kvm; +Cc: linux-kselftest, pbonzini, shuah, tabba

KVM_CHECK_EXTENSION ioctl can return any negative value on error,
and not necessarily -1. Change the assertion to reflect that.

Signed-off-by: Fuad Tabba <tabba@google.com>
---
 tools/testing/selftests/kvm/lib/kvm_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
index 5c70596dd1b9..a2b732cf96ea 100644
--- a/tools/testing/selftests/kvm/lib/kvm_util.c
+++ b/tools/testing/selftests/kvm/lib/kvm_util.c
@@ -82,7 +82,7 @@ int kvm_check_cap(long cap)
 
 	kvm_fd = open_kvm_dev_path_or_exit();
 	ret = ioctl(kvm_fd, KVM_CHECK_EXTENSION, cap);
-	TEST_ASSERT(ret != -1, "KVM_CHECK_EXTENSION IOCTL failed,\n"
+	TEST_ASSERT(ret >= 0, "KVM_CHECK_EXTENSION IOCTL failed,\n"
 		"  rc: %i errno: %i", ret, errno);
 
 	close(kvm_fd);
-- 
2.32.0.272.g935e593368-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: selftests: Fix kvm_check_cap() assertion
  2021-06-15 15:04 [PATCH] KVM: selftests: Fix kvm_check_cap() assertion Fuad Tabba
@ 2021-06-17 17:07 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2021-06-17 17:07 UTC (permalink / raw)
  To: Fuad Tabba, kvm; +Cc: linux-kselftest, shuah

On 15/06/21 17:04, Fuad Tabba wrote:
> KVM_CHECK_EXTENSION ioctl can return any negative value on error,
> and not necessarily -1. Change the assertion to reflect that.
> 
> Signed-off-by: Fuad Tabba <tabba@google.com>
> ---
>   tools/testing/selftests/kvm/lib/kvm_util.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
> index 5c70596dd1b9..a2b732cf96ea 100644
> --- a/tools/testing/selftests/kvm/lib/kvm_util.c
> +++ b/tools/testing/selftests/kvm/lib/kvm_util.c
> @@ -82,7 +82,7 @@ int kvm_check_cap(long cap)
>   
>   	kvm_fd = open_kvm_dev_path_or_exit();
>   	ret = ioctl(kvm_fd, KVM_CHECK_EXTENSION, cap);
> -	TEST_ASSERT(ret != -1, "KVM_CHECK_EXTENSION IOCTL failed,\n"
> +	TEST_ASSERT(ret >= 0, "KVM_CHECK_EXTENSION IOCTL failed,\n"
>   		"  rc: %i errno: %i", ret, errno);
>   
>   	close(kvm_fd);
> 

Queued, thanks.

Paolo


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-17 17:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 15:04 [PATCH] KVM: selftests: Fix kvm_check_cap() assertion Fuad Tabba
2021-06-17 17:07 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.