@@ -1436,6 +1436,10 @@ CpuInfoList *qmp_query_cpus(Error **errp)
info->value->current = (cpu == first_cpu);
info->value->halted = cpu->halted;
info->value->thread_id = cpu->thread_id;
+ info->value->model = g_strdup(cpu->model_name);
+ info->value->accel = cpu->accel_id;
+ info->value->has_model = info->value->has_accel =
+ info->value->model != NULL;
#if defined(TARGET_I386)
info->value->has_pc = true;
info->value->pc = env->eip + env->segs[R_CS].base;
@@ -616,6 +616,10 @@
#
# @thread_id: ID of the underlying host thread
#
+# @accel: #optional accelerator id (since 2.4)
+#
+# @model: #optional cpu model name (since 2.4)
+#
# Since: 0.14.0
#
# Notes: @halted is a transient state that changes frequently. By the time the
@@ -623,7 +627,8 @@
##
{ 'type': 'CpuInfo',
'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
- '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
+ '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int',
+ '*accel': 'AccelId', '*model': 'str'} }
##
# @query-cpus:
The QMP command query-cpus now additionally displays a model name and the backing accelerator. Both are omitted if the model name is not initialized. request: { "execute" : "query-cpus" } answer: { { "current": true, "CPU": 0, "model": "2827-ga2", "halted": false, "accel": "kvm", "thread_id": 31917 }, ... } Signed-off-by: Michael Mueller <mimu@linux.vnet.ibm.com> --- cpus.c | 4 ++++ qapi-schema.json | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-)