Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932387AbbDMN5X (ORCPT ); Mon, 13 Apr 2015 09:57:23 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:50869 "EHLO e06smtp14.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754078AbbDMN5G (ORCPT ); Mon, 13 Apr 2015 09:57:06 -0400 From: Michael Mueller To: qemu-devel@nongnu.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Eduardo Habkost , Gleb Natapov , Alexander Graf , Christian Borntraeger , "Jason J. Herne" , Cornelia Huck , Paolo Bonzini , Michael Mueller , Andreas Faerber , Richard Henderson , Daniel Hansel Subject: [PATCH v5 03/17] Extend QMP command query-cpus to return accelerator id and model name Date: Mon, 13 Apr 2015 15:56:22 +0200 Message-Id: <1428933396-37887-4-git-send-email-mimu@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1428933396-37887-1-git-send-email-mimu@linux.vnet.ibm.com> References: <1428933396-37887-1-git-send-email-mimu@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15041313-0017-0000-0000-000003B07202 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2172 Lines: 70 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 --- cpus.c | 4 ++++ qapi-schema.json | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index e6dcae3..00f33b9 100644 --- a/cpus.c +++ b/cpus.c @@ -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; diff --git a/qapi-schema.json b/qapi-schema.json index 540e520..215a7bc 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -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: -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/