From patchwork Thu Jun 23 20:23:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Krempa X-Patchwork-Id: 9195989 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 005616077D for ; Thu, 23 Jun 2016 20:27:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB25C2846E for ; Thu, 23 Jun 2016 20:27:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFA9428473; Thu, 23 Jun 2016 20:27:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 730D82846E for ; Thu, 23 Jun 2016 20:27:35 +0000 (UTC) Received: from localhost ([::1]:39204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGBDo-0000Zc-6f for patchwork-qemu-devel@patchwork.kernel.org; Thu, 23 Jun 2016 16:27:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGBA1-0005jj-I6 for qemu-devel@nongnu.org; Thu, 23 Jun 2016 16:23:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGBA0-0004uZ-Kx for qemu-devel@nongnu.org; Thu, 23 Jun 2016 16:23:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGBA0-0004uV-Bt for qemu-devel@nongnu.org; Thu, 23 Jun 2016 16:23:36 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E67D063326 for ; Thu, 23 Jun 2016 20:23:35 +0000 (UTC) Received: from angien.brq.redhat.com (dhcp129-199.brq.redhat.com [10.34.129.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5NKNP9K032377; Thu, 23 Jun 2016 16:23:34 -0400 From: Peter Krempa To: qemu-devel@nongnu.org Date: Thu, 23 Jun 2016 22:23:24 +0200 Message-Id: <3b55c78a3f4f12d143ae7b42209f1900bc2c6cc2.1466713052.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 23 Jun 2016 20:23:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/3] [VARIANT 1] qapi: Change 'core' to 'core-id' in 'CpuInstanceProperties' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mammedov , Peter Krempa , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP struct CPUCore uses 'core-id' as the property name. As docs for query-hotpluggable-cpus state that the cpu core properties should be passed back to device_add by management in case new members are added and thus the names for the fields should be kept in sync. Signed-off-by: Peter Krempa Reviewed-by: David Gibson --- hmp.c | 4 ++-- hw/ppc/spapr.c | 4 ++-- include/hw/cpu/core.h | 3 +++ qapi-schema.json | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/hmp.c b/hmp.c index 997a768..543f087 100644 --- a/hmp.c +++ b/hmp.c @@ -2463,8 +2463,8 @@ void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict) if (c->has_socket) { monitor_printf(mon, " socket: \"%" PRIu64 "\"\n", c->socket); } - if (c->has_core) { - monitor_printf(mon, " core: \"%" PRIu64 "\"\n", c->core); + if (c->has_core_id) { + monitor_printf(mon, " core: \"%" PRIu64 "\"\n", c->core_id); } if (c->has_thread) { monitor_printf(mon, " thread: \"%" PRIu64 "\"\n", c->thread); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 778fa25..0b6bb9c 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2367,8 +2367,8 @@ static HotpluggableCPUList *spapr_query_hotpluggable_cpus(MachineState *machine) cpu_item->type = spapr_get_cpu_core_type(machine->cpu_model); cpu_item->vcpus_count = smp_threads; - cpu_props->has_core = true; - cpu_props->core = i * smt; + cpu_props->has_core_id = true; + cpu_props->core_id = i * smt; /* TODO: add 'has_node/node' here to describe to which node core belongs */ diff --git a/include/hw/cpu/core.h b/include/hw/cpu/core.h index 4540a7d..79ac79c 100644 --- a/include/hw/cpu/core.h +++ b/include/hw/cpu/core.h @@ -26,6 +26,9 @@ typedef struct CPUCore { int nr_threads; } CPUCore; +/* Note: topology field names need to be kept in sync with + * 'CpuInstanceProperties' */ + #define CPU_CORE_PROP_CORE_ID "core-id" #endif diff --git a/qapi-schema.json b/qapi-schema.json index 24ede28..37ef5fd 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -4271,7 +4271,7 @@ # # @node: #optional NUMA node ID the CPU belongs to # @socket: #optional socket number within node/board the CPU belongs to -# @core: #optional core number within socket the CPU belongs to +# @core-id: #optional core number within socket the CPU belongs to # @thread: #optional thread number within core the CPU belongs to # # Since: 2.7 @@ -4279,7 +4279,7 @@ { 'struct': 'CpuInstanceProperties', 'data': { '*node': 'int', '*socket': 'int', - '*core': 'int', + '*core-id': 'int', '*thread': 'int' } }