From patchwork Mon May 20 15:29:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1102099 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4572sm3s4zz9sDn for ; Tue, 21 May 2019 01:30:52 +1000 (AEST) Received: from localhost ([127.0.0.1]:37231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSkFW-0001Ds-D4 for incoming@patchwork.ozlabs.org; Mon, 20 May 2019 11:30:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSkEJ-0000rT-Td for qemu-devel@nongnu.org; Mon, 20 May 2019 11:29:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSkEH-0004XT-Sk for qemu-devel@nongnu.org; Mon, 20 May 2019 11:29:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43586) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hSkEF-0004Uw-Ki; Mon, 20 May 2019 11:29:31 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 480375D61E; Mon, 20 May 2019 15:29:25 +0000 (UTC) Received: from thinkpad.redhat.com (unknown [10.40.205.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA42219C68; Mon, 20 May 2019 15:29:22 +0000 (UTC) From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 20 May 2019 17:29:21 +0200 Message-Id: <20190520152921.15959-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 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]); Mon, 20 May 2019 15:29:25 +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] numa: improve cpu hotplug error message with a wrong node-id 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: Peter Maydell , Eduardo Habkost , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Igor Mammedov , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" On pseries, core-ids are strongly binded to a node-id by the command line option. If a user tries to add a CPU to the wrong node, he has an error but it is not really helpful: qemu-system-ppc64 ... -smp 1,maxcpus=64,cores=1,threads=1,sockets=1 \ -numa node,nodeid=0 -numa node,nodeid=1 ... (qemu) device_add power9_v2.0-spapr-cpu-core,core-id=30,node-id=1 Error: node-id=1 must match numa node specified with -numa option This patch improves this error message by giving to the user the good node-id to use with the core-id he's providing: Error: core-id 30 can only be plugged into node-id 0 Signed-off-by: Laurent Vivier --- numa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/numa.c b/numa.c index 3875e1efda3a..c419c5b5b8ee 100644 --- a/numa.c +++ b/numa.c @@ -470,8 +470,9 @@ void numa_cpu_pre_plug(const CPUArchId *slot, DeviceState *dev, Error **errp) "node-id", errp); } } else if (node_id != slot->props.node_id) { - error_setg(errp, "node-id=%d must match numa node specified " - "with -numa option", node_id); + error_setg(errp, + "core-id %"PRId64" can only be plugged into node-id %"PRId64, + slot->props.core_id, slot->props.node_id); } }