[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 11/52] accel/kvm: Add hybrid info when check cpu num
From: |
Zhao Liu |
Subject: |
[RFC 11/52] accel/kvm: Add hybrid info when check cpu num |
Date: |
Mon, 13 Feb 2023 17:49:54 +0800 |
From: Zhao Liu <zhao1.liu@intel.com>
As the generic code, kvm should respect the different topologies: smp
or hybrid.
So improve the topology related informantion here.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
accel/kvm/kvm-all.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 9b2658265561..e62df7b579d0 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2361,12 +2361,13 @@ static int kvm_init(MachineState *ms)
static const char upgrade_note[] =
"Please upgrade to at least kernel 2.6.29 or recent kvm-kmod\n"
"(see http://sourceforge.net/projects/kvm).\n";
+ const char *cpu_name = machine_topo_is_smp(ms) ? "SMP" : "Hybrid";
struct {
const char *name;
int num;
} num_cpus[] = {
- { "SMP", ms->smp.cpus },
- { "hotpluggable", ms->smp.max_cpus },
+ { cpu_name, machine_topo_get_cpus(ms) },
+ { "hotpluggable", machine_topo_get_max_cpus(ms) },
{ NULL, }
}, *nc = num_cpus;
int soft_vcpus_limit, hard_vcpus_limit;
--
2.34.1
- Re: [RFC 08/52] machine: Add helpers to get cpu topology info from MachineState.topo, (continued)
[RFC 09/52] hw/machine: Introduce core type for hybrid topology, Zhao Liu, 2023/02/13
[RFC 10/52] machine: Replace MachineState.topo.smp access with topology helpers, Zhao Liu, 2023/02/13
[RFC 11/52] accel/kvm: Add hybrid info when check cpu num,
Zhao Liu <=
[RFC 12/52] hw/acpi: Replace MachineState.smp access with topology helpers, Zhao Liu, 2023/02/13
[RFC 14/52] hw/smbios: Use generic topology name and helper, Zhao Liu, 2023/02/13
[RFC 13/52] cpu/core: Use generic topology helper for "help" to set nr_threads, Zhao Liu, 2023/02/13
[RFC 15/52] migration/postcopy-ram: Use generic topology name and helper, Zhao Liu, 2023/02/13