]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qapi/machine: Add @qom-type field to CpuInfoFast structure
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 15 Jul 2025 08:53:49 +0000 (10:53 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 15 Jul 2025 17:28:36 +0000 (19:28 +0200)
Knowing the QOM type name of a CPU can be useful,
in particular to infer its model name.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Message-Id: <20250715090624.52377-2-philmd@linaro.org>

hw/core/machine-qmp-cmds.c
qapi/machine.json

index 1af0f29f7d390f422e59faa175328fd15775ce5d..b9e7eb64e028d28141be37bedb38566be0c4982d 100644 (file)
@@ -48,6 +48,7 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
         value->cpu_index = cpu->cpu_index;
         value->qom_path = object_get_canonical_path(OBJECT(cpu));
         value->thread_id = cpu->thread_id;
+        value->qom_type = g_strdup(object_get_typename(OBJECT(cpu)));
 
         if (mc->cpu_index_to_instance_props) {
             CpuInstanceProperties *props;
index f80ba264b53005c03313efe2932f05c3948675d8..6d3a480bea338b9979948a2dd8c29dd29fdcf4a8 100644 (file)
@@ -76,6 +76,8 @@
 #
 # @cpu-index: index of the virtual CPU
 #
+# @qom-type: QOM type name of the CPU (since 10.1)
+#
 # @qom-path: path to the CPU object in the QOM tree
 #
 # @thread-id: ID of the underlying host thread
@@ -89,6 +91,7 @@
 ##
 { 'union'         : 'CpuInfoFast',
   'base'          : { 'cpu-index'    : 'int',
+                      'qom-type'     : 'str',
                       'qom-path'     : 'str',
                       'thread-id'    : 'int',
                       '*props'       : 'CpuInstanceProperties',