From patchwork Fri Feb 2 00:42:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 10196177 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 39FEA60362 for ; Fri, 2 Feb 2018 00:50:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1855528D97 for ; Fri, 2 Feb 2018 00:50:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A7D028D9E; Fri, 2 Feb 2018 00:50:20 +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.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 4791328D97 for ; Fri, 2 Feb 2018 00:50:18 +0000 (UTC) Received: from localhost ([::1]:49438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehPYX-0007U7-NL for patchwork-qemu-devel@patchwork.kernel.org; Thu, 01 Feb 2018 19:50:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehPW9-0005uD-DS for qemu-devel@nongnu.org; Thu, 01 Feb 2018 19:48:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehPV5-0000Fc-9m for qemu-devel@nongnu.org; Thu, 01 Feb 2018 19:47:49 -0500 Received: from mail-sn1nam02on0076.outbound.protection.outlook.com ([104.47.36.76]:16128 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ehPV4-0000E3-RR for qemu-devel@nongnu.org; Thu, 01 Feb 2018 19:46:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=68k2I1IkumbGi26NwJg3JssVwrStJ02BOcjYYH94uX4=; b=waZmOND13tDP31Cs69R7Pxw8Coic+33aa0bgXuvg5wxFMSTyDGTwxPbI3/M4VofWOozlahRImEkajgCVWsfHiuP/5fbs7BUCm4DCplXNjb99Vl2iIfoR5Ul2LjX11H7QQJ9AiFpvA9yR3OXEhqucei4+H908zqKNffz5jh+YTZg= Received: from MWHPR0201CA0011.namprd02.prod.outlook.com (10.167.160.152) by BN6PR02MB3379.namprd02.prod.outlook.com (10.161.153.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Fri, 2 Feb 2018 00:46:40 +0000 Received: from BL2NAM02FT026.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::202) by MWHPR0201CA0011.outlook.office365.com (2603:10b6:301:74::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.444.14 via Frontend Transport; Fri, 2 Feb 2018 00:46:39 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT026.mail.protection.outlook.com (10.152.77.156) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.444.13 via Frontend Transport; Fri, 2 Feb 2018 00:46:38 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:39564 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1ehPV0-0006nV-C2; Thu, 01 Feb 2018 16:46:38 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1ehPV0-0001cQ-8H; Thu, 01 Feb 2018 16:46:38 -0800 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w120kZ8A028993; Thu, 1 Feb 2018 16:46:35 -0800 Received: from [172.19.2.220] (helo=xsjalistai50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1ehPUx-0001bc-K6; Thu, 01 Feb 2018 16:46:35 -0800 From: Alistair Francis To: Date: Thu, 1 Feb 2018 16:42:05 -0800 Message-ID: <56ba11cee61d769a9a2816fa990d472ab1480906.1517532021.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(396003)(346002)(39380400002)(376002)(2980300002)(438002)(189003)(199004)(47776003)(5660300001)(48376002)(50466002)(81166006)(50226002)(8676002)(81156014)(8936002)(4326008)(51416003)(2906002)(36386004)(6916009)(6666003)(7696005)(76176011)(478600001)(39060400002)(2950100002)(77096007)(356003)(26005)(305945005)(63266004)(9786002)(316002)(16586007)(118296001)(36756003)(106466001)(2351001)(336011)(106002)(54906003)(186003)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR02MB3379; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT026; 1:vbtDIub3eh9qIjOvk7nSYzKTAkjPZdnH968uQrtrFRHfPjlDLwGdrAev3JbO9OfLPWO1ixNReEf3ItiXBAlLPwT1cKnszSmOXNw/O2ANZLlsw4BCbJ2f0VuPFms0V8G8 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca82f409-42c8-4cfb-28ac-08d569d66b74 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603307)(7153060); SRVR:BN6PR02MB3379; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3379; 3:9ymg5iR56FNTe+gNo+UYoSFRomflVe0jbNsz1ydXnFz5UneEPa+M4dsjBr52AsgiT+O7y/6XE0RAw92QcB20eZvR9wKsh723n1M+WKnO1X178IQwkxjKciNq7xuICBm7dRSTXQ9IqvGQ1c5/vhIpB2C9+bIlsBPmEeTcTTjrjOlGXV8IFDtU9hzUQwjumBL1xGXN5b4lthBNVBRLNasiKHpYv7mwoW97RK13xnuawMQn5U5IZ5sJ4LVfg1f0rPRIzHMskoEPwzLC5lRins4U9jTISwme0srjp8heZ4hdKeq+zySW5o8JJqG5WpORGlsGXe9zb0jksH5eejbOTEa73pIo3BANZrlqGnNvga3LM5k=; 25:8nyCW+7Nd530FlSlxhUzxs7+u6g7X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/pInB8azAaY8HYsvU36FmqulPsBx2qRobDghHPxnBJf2zqW1JbpaNPE9WamwdMh119FR X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93004095)(3231101)(2400082)(944501161)(10201501046)(3002001)(6055026)(6041288)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:BN6PR02MB3379; BCL:0; PCL:0; RULEID:; SRVR:BN6PR02MB3379; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3379; 4:GesyNCbF0+12UoO18oVji3C7ZB9Eb+Qed/uHk9lGfMMdpLhY7/ooBBgxMxC7KwbjMeii5HF3x43Fy2HIJzDYGyLbdgX96DEr/xX53pOneaoS85tqoXRpi7f5vlhpk6tZU/Pmlp4aAjt7jtIgU7uJeP8v5woYH/Igjy0+mVWUr8lDyAfzEJA9yhvC0ggiKIqUCSRtdcJ4tI0/8+CR4DWPf4/2BU1McfH0GNMdDXD1g6f7Oz/j6XOZfc7R+VZl7qWODb88DW2a+Y3s8tPEZOrQj//QS+MpW1gysXigdWFVKcPrsCV5ixHm0bvt0bqrhtfC X-Forefront-PRVS: 05715BE7FD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR02MB3379; 23:+D2p070h6lJYYHyXYaW09LNNEcmFEsUw00iKpI1Xf?= =?us-ascii?Q?up1hjrm8LegUUHFcmMoAo0MZnRX6eaGRYKWmsSLqkDzM0/OHPbuFnFr5X5x8?= =?us-ascii?Q?3YeiZ+o8B7LJm2FhXRYZ3xxc610s/Y29bmyoUN7iPPQKgqPxAvgftPTAMGiK?= =?us-ascii?Q?aKqhu/H7slo8NBxTH8S3ATWNUDXmQeK9cGXks99lT9apANUlAP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riginalArrivalTime: 02 Feb 2018 00:46:38.7610 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca82f409-42c8-4cfb-28ac-08d569d66b74 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB3379 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.36.76 Subject: [Qemu-devel] [PATCH v5 1/6] machine: Convert the valid cpu types to use cpu_model 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@linaro.org, ehabkost@redhat.com, f4bug@amsat.org, alistair.francis@xilinx.com, imammedo@redhat.com, marcel@redhat.com, alistair23@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP As cpu_type is not a user visible string let's convert the valid_cpu_types to compare against cpu_model instead. This way we have a user friendly string to report back. Once we have a cpu_type to cpu_model conversion this patch should be reverted and we should use cpu_type instead. Signed-off-by: Alistair Francis --- hw/core/machine.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index cdc1163dc6..de5bac1c84 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -776,13 +776,12 @@ void machine_run_board_init(MachineState *machine) /* If the machine supports the valid_cpu_types check and the user * specified a CPU with -cpu check here that the user CPU is supported. */ - if (machine_class->valid_cpu_types && machine->cpu_type) { - ObjectClass *class = object_class_by_name(machine->cpu_type); + if (machine_class->valid_cpu_types && machine->cpu_model) { int i; for (i = 0; machine_class->valid_cpu_types[i]; i++) { - if (object_class_dynamic_cast(class, - machine_class->valid_cpu_types[i])) { + if (!strcmp(machine->cpu_model, + machine_class->valid_cpu_types[i])) { /* The user specificed CPU is in the valid field, we are * good to go. */ @@ -792,8 +791,8 @@ void machine_run_board_init(MachineState *machine) if (!machine_class->valid_cpu_types[i]) { /* The user specified CPU is not valid */ - error_report("Invalid CPU type: %s", machine->cpu_type); - error_printf("The valid types are: %s", + error_report("Invalid CPU model: %s", machine->cpu_model); + error_printf("The valid models are: %s", machine_class->valid_cpu_types[0]); for (i = 1; machine_class->valid_cpu_types[i]; i++) { error_printf(", %s", machine_class->valid_cpu_types[i]);