From patchwork Fri Jan 5 15:42:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 760197 Delivered-To: patch@linaro.org Received: by 2002:a5d:678d:0:b0:336:6142:bf13 with SMTP id v13csp107557wru; Fri, 5 Jan 2024 07:53:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbTl/Bh804dDvYx/MKk5zg3l/XGmvYN8wwqpAf3d2JiFO7F1gKgKzzfH5ejlum6zdIaRLo X-Received: by 2002:ac8:7c44:0:b0:429:7d11:e053 with SMTP id o4-20020ac87c44000000b004297d11e053mr778562qtv.20.1704470005050; Fri, 05 Jan 2024 07:53:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704470005; cv=none; d=google.com; s=arc-20160816; b=0uq+SNTDXciu8bKxVs87LZ5FORiGqmMAVkkwbnP401Q+1oZnKOvoZETPzw5hP6gm2h +Z7knU3Z21O5VJMEtGODBwGhar5TW5r8zA5yeKPf5s+7wygbTUPxFMM3ZKyGoJIzpm/9 YC+sYiOAIVLdPx5ncEMPEQI4OHdN6TdUVoYC/seoMikWvBlwZ+B1+FmQ2SKkBt8d8gPr fc1kOqeBrm0pWSpVv4mg0XqR7man30FLmnQ6X/ie94qa7daR3O6qW7g53Y0h1/o04buu Hqk+9TxUovhhskEtnCGhmeoCCcxaetRtmlj20Hv1Hk/UBCrze4+KnDoci7aqhvheY0d1 8qpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TaWEpr5f/U/wZNl7ClicoZnkchpUab2rsBaBsce3JqA=; fh=3nCCaiiW3tvaCvW7R3dnb3A1HVjFyaxnPEYthLbnaW4=; b=oXRJG1zJVdbEBwjHbncQcF5FgxGJ5JKIAG5NuI7u0VVT+YSGxxz13QsTqFARJqwXai ArpIjgLUJMPC1lADGT8ABXJResNJPYiHXjA3fHZGg8oGPcEDbvTT+qiGkw9oEpfR7a7y BVtjfuNKJmuF6UJY1jaPw5NR5q/3u4dp5JPvtHvIZRnwBMZMTyq/yP5wQiz9eiYmJ26O iDikzhc6rosA6EWg/0aFRHHqBfyMyluMbs/yV6sfQuuEzg8eqkXZ4QROS7T0lxFyOAWT VYmWotezUiFVUdK4r+MRY70cQTzczW8AXIKObjcTK8E5lQ4Jbtr0+/UOW635GH9M6RRQ 8MNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ILKT0InO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d17-20020a05622a101100b0042803178a9dsi2025667qte.188.2024.01.05.07.53.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jan 2024 07:53:25 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ILKT0InO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmPg-000581-V1; Fri, 05 Jan 2024 10:47:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rLmOm-000204-QK for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:25 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmOj-0003qM-D4 for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:46:16 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40d4f5d902dso16146425e9.2 for ; Fri, 05 Jan 2024 07:46:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469572; x=1705074372; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TaWEpr5f/U/wZNl7ClicoZnkchpUab2rsBaBsce3JqA=; b=ILKT0InOW9Wh0TE9nnBj+WiviH/WaLZ2lala2LTM3Aovv0TCxl0Pbwsc9kFU21n0b9 1DerARmCTs0ZNtAjGFfFlADSzSrWqBtdT6c9OexpGORqpgTGKiQNneNccpIuTSkvuVZB KblNMxRPeXNDg8ICd5uQ0ErMktTa9w/pq+f3jAKVX9Lm6tqPTV8f5bFBW0wf9himunrL ykMetXUvmr1a3RXbLacRdY3kjsrVVVT3RWv61tAUS4HoEu+kGsd6HSiup7Df9XZOy+8D CBcAwY2UHg1DBoGyKfZi4IIGiL+7BQuOmcT36oKycCdiqNVOKEpVv4U2tglj2CqkVMAT ED9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469572; x=1705074372; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TaWEpr5f/U/wZNl7ClicoZnkchpUab2rsBaBsce3JqA=; b=bjk89RuKEXhwB+Asie2e5wH9KzpAd9ED+4PEC0w/osYf9lxtxdNTVxJpTrKp6KweNt F8ZtvE8yesQ6Pt+OY7vjPg7GP8hOiIjqrroPhYJwwxsgDctLCKL4taF2YkN9KvA9S7L3 ApgbkSso9tynJuWEUn2sKgjxhpm2+fJ/OuqaWAzdSSy0ze4XRi2T0ayN/ATnhJDCyafV WNGnamsWRvzuIKsQrCjbl9cYGPP1RXjhhcuzyZYlMwjfxWFJrPWM92zv3Og4WU+cBfYZ rPc0wjyGDp9pyUleTuLcydHyxxpWzz+5YoKR8atPsoca6blgabjgHOI/pwjbcXP7QZaz dFmA== X-Gm-Message-State: AOJu0YxfiFnYXOQBrpcEja0AWM3sDd+ic8AdyIUWlU3tOBoaUN6DQSGx zDVzR3SbgPi4XE7wtLwyJ3xFxuDh+2ZLXuU8m+KKg0O7mBw= X-Received: by 2002:a05:600c:138e:b0:40d:9485:cc89 with SMTP id u14-20020a05600c138e00b0040d9485cc89mr1204952wmf.74.1704469571776; Fri, 05 Jan 2024 07:46:11 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id k9-20020a05600c1c8900b0040e3a1f88f2sm1376690wms.15.2024.01.05.07.46.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:46:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 27/71] machine: Print CPU model name instead of CPU type Date: Fri, 5 Jan 2024 16:42:20 +0100 Message-ID: <20240105154307.21385-28-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Gavin Shan The names of supported CPU models instead of CPU types should be printed when the user specified CPU type isn't supported, to be consistent with the output from '-cpu ?'. Correct the error messages to print CPU model names instead of CPU type names. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20231204004726.483558-5-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/core/machine.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index c523ce32eb..fc239101f9 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1421,15 +1421,19 @@ static bool is_cpu_type_supported(const MachineState *machine, Error **errp) /* The user specified CPU type isn't valid */ if (!mc->valid_cpu_types[i]) { - error_setg(errp, "Invalid CPU type: %s", machine->cpu_type); + g_autofree char *requested = cpu_model_from_type(machine->cpu_type); + error_setg(errp, "Invalid CPU model: %s", requested); if (!mc->valid_cpu_types[1]) { - error_append_hint(errp, "The only valid type is: %s\n", - mc->valid_cpu_types[0]); + g_autofree char *model = cpu_model_from_type( + mc->valid_cpu_types[0]); + error_append_hint(errp, "The only valid type is: %s\n", model); } else { - error_append_hint(errp, "The valid types are: "); + error_append_hint(errp, "The valid models are: "); for (i = 0; mc->valid_cpu_types[i]; i++) { + g_autofree char *model = cpu_model_from_type( + mc->valid_cpu_types[i]); error_append_hint(errp, "%s%s", - mc->valid_cpu_types[i], + model, mc->valid_cpu_types[i + 1] ? ", " : ""); } error_append_hint(errp, "\n");