diff options
author | Xiaoyao Li <xiaoyao.li@intel.com> | 2025-05-08 10:59:36 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-05-28 19:35:54 +0200 |
commit | 77b5403a0298a5460554f768a2098fd21588e555 (patch) | |
tree | 1f8701ca49b0ddba465333834b7c1aa99324a416 | |
parent | 6e250463b08b4028123f201343ee72099ef81e68 (diff) | |
download | qemu-77b5403a0298a5460554f768a2098fd21588e555.zip qemu-77b5403a0298a5460554f768a2098fd21588e555.tar.gz qemu-77b5403a0298a5460554f768a2098fd21588e555.tar.bz2 |
kvm: Check KVM_CAP_MAX_VCPUS at vm level
KVM with TDX support starts to report different KVM_CAP_MAX_VCPUS per
different VM types. So switch to check the KVM_CAP_MAX_VCPUS at vm level.
KVM still returns the global KVM_CAP_MAX_VCPUS when the KVM is old that
doesn't report different value at vm level.
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250508150002.689633-31-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | accel/kvm/kvm-all.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 42d239c..71e6060 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2431,7 +2431,7 @@ static int kvm_recommended_vcpus(KVMState *s) static int kvm_max_vcpus(KVMState *s) { - int ret = kvm_check_extension(s, KVM_CAP_MAX_VCPUS); + int ret = kvm_vm_check_extension(s, KVM_CAP_MAX_VCPUS); return (ret) ? ret : kvm_recommended_vcpus(s); } |