From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YherM-0005wk-OP for qemu-devel@nongnu.org; Mon, 13 Apr 2015 09:57:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YherI-0003iY-Un for qemu-devel@nongnu.org; Mon, 13 Apr 2015 09:57:08 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:36785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YherI-0003i9-JG for qemu-devel@nongnu.org; Mon, 13 Apr 2015 09:57:04 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Apr 2015 14:57:03 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 3134617D8059 for ; Mon, 13 Apr 2015 14:57:36 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t3DDv0Et64749592 for ; Mon, 13 Apr 2015 13:57:00 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t3DDv06l031647 for ; Mon, 13 Apr 2015 07:57:00 -0600 From: Michael Mueller Date: Mon, 13 Apr 2015 15:56:22 +0200 Message-Id: <1428933396-37887-4-git-send-email-mimu@linux.vnet.ibm.com> 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> Subject: [Qemu-devel] [PATCH v5 03/17] Extend QMP command query-cpus to return accelerator id and model name List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 , Daniel Hansel , "Jason J. Herne" , Cornelia Huck , Paolo Bonzini , Richard Henderson , Andreas Faerber , Michael Mueller 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