From patchwork Mon Jun 27 05:29:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 640800 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rdHdf0FGJz9syB for ; Mon, 27 Jun 2016 15:32:54 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b=ovXwRChd; dkim-atps=neutral Received: from localhost ([::1]:56551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHPAB-0000AZ-TN for incoming@patchwork.ozlabs.org; Mon, 27 Jun 2016 01:32:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHP5P-0004Ee-5h for qemu-devel@nongnu.org; Mon, 27 Jun 2016 01:27:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHP5L-0008FE-1s for qemu-devel@nongnu.org; Mon, 27 Jun 2016 01:27:54 -0400 Received: from ozlabs.org ([103.22.144.67]:57616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHP5K-0008EO-Ew; Mon, 27 Jun 2016 01:27:50 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3rdHWk4B0qz9t19; Mon, 27 Jun 2016 15:27:46 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1467005266; bh=xgXJ46hHr1mkltWHjV9VMrqX55gU1y7FKDoz4o4R5Ro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ovXwRChdbIbqIma+atnPjSXSIAvmMDKo4iYTR35F4QQ9l6vFtp/twLKSVOGkyQjau xHSG3G9RYQph2eist1Xs9STPpHHIpyHdLUQBqrRvPoY4dSn1CH6CsBlpyxZHH5bT1l JKfSRpUkS5PMp239KpiwetfTTqhZQyYicM0PnzoM= From: David Gibson To: peter.maydell@linaro.org Date: Mon, 27 Jun 2016 15:29:32 +1000 Message-Id: <1467005372-23288-5-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1467005372-23288-1-git-send-email-david@gibson.dropbear.id.au> References: <1467005372-23288-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PULL 4/4] qapi: keep names in 'CpuInstanceProperties' in sync with struct CPUCore 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: pkrempa@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, qemu-ppc@nongnu.org, bharata@linux.vnet.ibm.com, imammedo@redhat.com, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Krempa struct CPUCore uses 'id' suffix in 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: Eric Blake Reviewed-by: Igor Mammedov [dwg: Removed a duplicated word in comment] Signed-off-by: David Gibson --- hmp.c | 16 ++++++++-------- hw/ppc/spapr.c | 4 ++-- include/hw/cpu/core.h | 3 +++ qapi-schema.json | 19 ++++++++++--------- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/hmp.c b/hmp.c index 997a768..925601a 100644 --- a/hmp.c +++ b/hmp.c @@ -2457,17 +2457,17 @@ void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict) c = l->value->props; monitor_printf(mon, " CPUInstance Properties:\n"); - if (c->has_node) { - monitor_printf(mon, " node: \"%" PRIu64 "\"\n", c->node); + if (c->has_node_id) { + monitor_printf(mon, " node-id: \"%" PRIu64 "\"\n", c->node_id); } - if (c->has_socket) { - monitor_printf(mon, " socket: \"%" PRIu64 "\"\n", c->socket); + if (c->has_socket_id) { + monitor_printf(mon, " socket-id: \"%" PRIu64 "\"\n", c->socket_id); } - if (c->has_core) { - monitor_printf(mon, " core: \"%" PRIu64 "\"\n", c->core); + if (c->has_core_id) { + monitor_printf(mon, " core-id: \"%" PRIu64 "\"\n", c->core_id); } - if (c->has_thread) { - monitor_printf(mon, " thread: \"%" PRIu64 "\"\n", c->thread); + if (c->has_thread_id) { + monitor_printf(mon, " thread-id: \"%" PRIu64 "\"\n", c->thread_id); } l = l->next; 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 a075759..ba3bf14 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -4268,20 +4268,21 @@ # Note: currently there are 4 properties that could be present # but management should be prepared to pass through other # properties with device_add command to allow for future -# interface extension. +# interface extension. This also requires the filed names to be kept in +# sync with the properties passed to -device/device_add. # -# @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 -# @thread: #optional thread number within core the CPU belongs to +# @node-id: #optional NUMA node ID the CPU belongs to +# @socket-id: #optional socket number within node/board the CPU belongs to +# @core-id: #optional core number within socket the CPU belongs to +# @thread-id: #optional thread number within core the CPU belongs to # # Since: 2.7 ## { 'struct': 'CpuInstanceProperties', - 'data': { '*node': 'int', - '*socket': 'int', - '*core': 'int', - '*thread': 'int' + 'data': { '*node-id': 'int', + '*socket-id': 'int', + '*core-id': 'int', + '*thread-id': 'int' } }