diff mbox series

[RFC,11/52] accel/kvm: Add hybrid info when check cpu num

Message ID 20230213095035.158240-12-zhao1.liu@linux.intel.com
State New
Headers show
Series Introduce hybrid CPU topology | expand

Commit Message

Zhao Liu Feb. 13, 2023, 9:49 a.m. UTC
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 mbox series

Patch

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;