[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221024113445.1022147-19-wei.w.wang@intel.com>
Date: Mon, 24 Oct 2022 19:34:45 +0800
From: Wei Wang <wei.w.wang@...el.com>
To: seanjc@...gle.com, pbonzini@...hat.com
Cc: dmatlack@...gle.com, vipinsh@...gle.com, ajones@...tanamicro.com,
eric.auger@...hat.com, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, Wei Wang <wei.w.wang@...el.com>
Subject: [PATCH v1 18/18] KVM: selftests/kvm_create_max_vcpus: check KVM_MAX_VCPUS
If the KVM side max vcpu number is larger than the one supported by the
userspace selftests, adjust the max number.
Signed-off-by: Wei Wang <wei.w.wang@...el.com>
---
tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
index 31b3cb24b9a7..bbdb371e21ed 100644
--- a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
+++ b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
@@ -50,6 +50,13 @@ int main(int argc, char *argv[])
pr_info("KVM_CAP_MAX_VCPU_ID: %d\n", kvm_max_vcpu_id);
pr_info("KVM_CAP_MAX_VCPUS: %d\n", kvm_max_vcpus);
+ pr_info("selftests KVM_MAX_VCPUS: %d\n", KVM_MAX_VCPUS);
+
+ if (kvm_max_vcpu_id > KVM_MAX_VCPUS)
+ kvm_max_vcpu_id = KVM_MAX_VCPUS;
+
+ if (kvm_max_vcpus > KVM_MAX_VCPUS)
+ kvm_max_vcpus = KVM_MAX_VCPUS;
/*
* Check that we're allowed to open nr_fds_wanted file descriptors and
--
2.27.0
Powered by blists - more mailing lists