From patchwork Wed Nov 8 22:58:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 836048 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="focp1wEL"; dkim-atps=neutral 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 3yXMWH062Zz9rvt for ; Thu, 9 Nov 2017 10:11:55 +1100 (AEDT) Received: from localhost ([::1]:34357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCZVg-0007ci-Vj for incoming@patchwork.ozlabs.org; Wed, 08 Nov 2017 18:11:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCZMs-0000pP-Rx for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:02:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCZMp-0003iT-NV for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:02:46 -0500 Received: from mail-by2nam01on0058.outbound.protection.outlook.com ([104.47.34.58]:57393 helo=NAM01-BY2-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 1eCZMp-0003hq-BB for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:02: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=U7kKAWV+BDHAUEro3mmyB6A2LU8BTDxou+qlPwQ5wIo=; b=focp1wELWgsmCO19i6J6o5Gjv5DeWzr8lpxpnMCvc2k/EsYK1iONGCqKg4fDSKx+aDTzLx8a9W/1OCWUBdsAgXHWlu52vBp9WeGIquTwkn2KDET/dyekwkEvI57IkB26R44U81iTOJv7EJtQG1WVuEm+UtzDWhGmtslfPedlvCg= Received: from SN4PR0201CA0044.namprd02.prod.outlook.com (10.162.76.30) by DM5PR02MB3386.namprd02.prod.outlook.com (10.164.152.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Wed, 8 Nov 2017 23:02:40 +0000 Received: from CY1NAM02FT007.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::209) by SN4PR0201CA0044.outlook.office365.com (2603:10b6:803:2e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.218.12 via Frontend Transport; Wed, 8 Nov 2017 23:02:39 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT007.mail.protection.outlook.com (10.152.75.5) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.197.9 via Frontend Transport; Wed, 8 Nov 2017 23:02:39 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1eCZMk-0001NR-IM; Wed, 08 Nov 2017 15:02:38 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1eCZMk-00037K-AF; Wed, 08 Nov 2017 15:02:38 -0800 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id vA8N2ZZW010388; Wed, 8 Nov 2017 15:02:36 -0800 Received: from [172.19.2.220] (helo=xsjalistai50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1eCZMg-00036u-VS; Wed, 08 Nov 2017 15:02:35 -0800 From: Alistair Francis To: Date: Wed, 8 Nov 2017 14:58:37 -0800 Message-ID: <7836aca1a2f07452ccebffcb3fd8178a08ce7241.1510181732.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23450.000 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.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(2980300002)(438002)(199003)(189002)(106466001)(77096006)(47776003)(478600001)(54906003)(6916009)(2950100002)(575784001)(39060400002)(5820100001)(4326008)(2351001)(33646002)(50466002)(356003)(23676003)(106002)(36756003)(316002)(50226002)(76176999)(63266004)(50986999)(8936002)(305945005)(9786002)(2870700001)(8676002)(2906002)(36386004)(81166006)(81156014)(5660300001)(118296001)(189998001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3386; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT007; 1:kGH73KH5+3Q9GJJyIKuatdw57HAte9dUuVs8zsmBny+4VdWAbCYi/UVyTV1kAEWWiMFzlI3bTcbMRrO+RmeWfn8L/Nj6Kg1r0FwDEqLC1frHSjUcDbhbv5sgYb3SeN+k X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b272fcde-9568-4a80-fd28-08d526fccf68 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603249); SRVR:DM5PR02MB3386; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 3:DZtJdmX1xC0datqX+MvvXtV6/ABaN05YyCkGy1C5iOoMqBMkqdJD8UHF6sBdhNUjMepJsFhDyY4haIWEFl4fgWqg92Jmw7Y5bgBezely313N5rCq/7PScMC4xVaNpJEKka98brBIXmegegN2KybnNsrp2v12giEsQ30HsSQ4BQpUIhzMn3CULKouhg+G1g/FNU0FimrvJRkeBJCmP/HQkT6pd51qXZ6Oiy0JjCKn3g5mDD89APk4uJrVPpB0fVuPu85LxVjUDCNAbHPAWBt2TQsZJM79el+MBjtofrAZlVU9j18a1GM10okKHNdVlKJVE0RMrxlsq/sZcebBKaWecLqNG3tHHflg7w3aHA77RVw=; 25:V+S0Eyr/PFSlWa6ithJg2udfKJHGG3nOFgD7dTzvR/Bq/AqOdhiLYqMaiKNujT2NWwP/bsWP0oJTpFNn0qYthtRN9s5JQETqsS+xkNkWrg+SFf4n/qd0hLfHLLvUaKaUDzOCnyFhpw53370b8045zh45d+pVNHdu57BK0TsomodSP5e50VBkRlKUVdoMAZAv95zo5jAref4G0esIE8hRTUBOZOflvLiJZPj69e0w1kT+bEO5pw9pFSPog4IhWlvhA89Vy+r9poLjuEielNUN6Xbr0oszfpgfmoklMozTaJ5Wb5neuvnZ+ozC/2MjgbMJWvN05myupldgyP1jcE4AFQ== X-MS-TrafficTypeDiagnostic: DM5PR02MB3386: X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 31:SOa7M2wRZpnpuzdAI2snC/U+/koBqEiq/O/3EQoBdd8uIxt/baTMAIEoR8/fPKyjsfhJk+L8h61hQm1tt4fvAIDl2DPo1ul7eTy9JwRLwBkn90vqor8hPaBSgcSCauPoP/gy1wAM6fiUgkdQtGl+nGSBqGjb9yga48a8xq3KwKTREa9ldMfhMhMiXsYLD2dauoOLnLiRVvM7pxAdNJCs/rOhYYTZMAtmdTu9jzs6/Hk=; 20:S0ZBjJrCHjz8pvOq1jsPDzE3bogkPV39Ac4JMWizI6lU37iz5WtdHoK68tQDIYMonGgaSwVei1MFf09EJM7zSTlwfzWgOS4XwZa3brgyLfVUTn9gscGGn4glN/xpxQGjc+aOYAvlWwenz1wgU0v9qdvAHF8zRsSSh7ysfrLwj6WOOICz3zcd5+bR8LGM3Rpg/ov5NMJqxSKcYVw9J2AlPbOYAWIiRiFQs8Dsnd/GTsLA7WSYLDiVwZFBKcEvYU50gEt8LEBnhzu1zDQBvO98LCIMQa+VPpwQW/QUfjOHB6/06ghfCk4RGEnaxX94j4WEGeoyRC0wHEchjrQYvfu3jdoYg7VymZc9VQfhOuWFbljPKNwNb2vSIQaKFCoHuu0QkTSRiBeh2hx7HSI+rtJws8KjKVsgVizIVywsfY1Jg7vISSQsvV6VGZgclRFxgJ1NsU7LYix6U1SnlqIe8GiAy4SmGzAHZCwBU164XoLuIU7Ark62TEh5bWQuvHgXPqCy X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93004095)(10201501046)(3231021)(3002001)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR02MB3386; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR02MB3386; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 4:gkOZsZ5HVjMjPDvBCwCSuKEB8CvcXNhdEhpyUdPOR8O1YV4tuinfDFJ1Cjv/tQ/XE9Slv3Q49sMiPy0FwcE63zuCWBu3G0FzUAoe6+QcnS6j2iTQy0hBqlvcKCyItIt5PKhJloYczruqqa1pWEIukVhJhPSrf/lEe1Hl78/xo4YPWb0IQ0eh5XbW2W11Gh3d4CFKiXVRCGWkzunh4qCmflgD30LbvI8NIknqAobxSJ0FApa6rIy5zEsorR4hmAVZE4tC9mcJ6m28jLE/s95LdsHn6j4DGCcdySv+iXnlNiWK5x6dYFkko/NEd1/VpiygrvvNWqXj18F7sqEyyZKckA== X-Forefront-PRVS: 0485417665 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR02MB3386; 23:ROhXzGUKyAELGLsldaLEkBnmRObKFAQIKu1sjtFb4?= wbskj6qHs+wRCCbunSg6sIVh3cT5rKtzFQUJ0Mw3oMMMYqFqS+ci4W9NNA1TLGnBPMQ4xmeqEOTJr4jL+7mIOllPrXH0APUktvJkTqAiAg2hR1cil1nIvhFK0ADeDY3QH0tsdgMEx8Yr7HMpELZFjzS4dcwa9B6LGPmbC+wJGUw/FHVjKzp3/d3Cxu2Gr5OZryceiZXB0c8q9hwPNLwrsNoly4msVgpvmkcGUWXN4gpdQ/USRBJ2A00ScOl+XM/MbsNL0NT6b+gJq6rVKJHW/gJdR3BQhVBAjbJ76z5g0sWARAiM9bugL2o3qqYe/z2s9pEWGDw4WIabbJ3hcR+Ho3pnNrSq6161F/2GsDCcKG4nOAv0OPl0mGG8FTFLXhDfWmCpLCCB84OTMof5VzTJ5nhJGd8QvUrfK98qifOCY4VCs1psG9x1dlBaydtFfxfA4942by7KJ+JVq1do9GRs/45Nutj2g0CL9ofptSdrgN8EkeqHzHGXEqTWNmusH6Gmu/7nUNpbWioh8bPYkb8MwehLsi4HgmdclUiNjt+o986XsdaD/TdicZ0OHdBrmFw/rSj4ZMlBW9ew076JN7YkmGJaVcfk1jQSi61BR+e55VgABmwLQx5sIvJBTJoC4M/7taAPQmB0/Pgiw7pCAKpE+sjIrtPIWNU6y4Aj/iILh83UblfeCB+VfRmmoTwvlDmtaGUQv70+ERfuK9EK7G9o/nB6Rmi3tE1JSmcJWJll97jlqqtlvbLd66iPxSmPiZ67s2KSJj8qgAJPlq5vZsTl8QgVRPkkKU+T19fh9n3NU6HfvX1sLXFxnjSOb97N39xKfDa+K8UmEO5JBXCT5B+7yismXTFtntiYHGTabiIK0N2MzEd1Ls6PGfu4sOZIhQjiRkdgiHPVaieFc+b9X9BqhtceZ7Ppo4nEO4u/zNTfqJFDkXY0odBfsZBd1ecRgvjTeDeYtY6CgCPJ0AGWnAGaOsZl8dYKjpqKFedAsfhHpnPKUznwfP8W1qI8ueGArJ2+R4= X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 6:DitQMEXjPPFdfBiWa48SgrjKXYoL4yNWUj9Si/xwwdeICmBe4uQaD6EcKH2VDLDbs0WZ4Lxw6GHBTh+fMRFrqjgzGXDfd7GxeaTXDavLkHDgEbRQOVWsNp7CqjLLbr3iL3zht7pfbYUBkX0VATvSlM7Hq0x0VcKrPWNxMyaF2V5viJ1g8ZM6nNRL+RL3CjM/i3wDtBbbfqYyNoK3USx2q1edBkLx23UA5Lz77b2S0khVw4saPmZPQCF8ugnvp14juSoEKxI5bUg3PuPvIAYelaHg+bymhDnN3xWNTFBTOprXZ+4FqX6bdsT0CKO+3LEAUloJlgsivj9meHzvjclJ/tGKxMavObm9u4LZ7oJsp0g=; 5:MU92d00rtd4UlIrK3XjYWsTlfnlzkz/YmMlHBTxrqOmIIcBUD7cmA/V8un9lDIAjTLhKTc+HoBI2+Z2+DyIeoPMV2bbitXAHdTjW0IhXQAqqxrSPp1dco5+obgSZTnQLJ9n+d9h3zDJmqFD+E3IhkUZbLaPp4bxivm3HK5q7XAU=; 24:RdGnp7rWiGfvbYWHqLlApWaek6Z/0+pR40czF+CvN+ere/zSspRIsFYsTMRG+gs2ZHE9Yd7yVlPzIFHWcAvXoBj7T4voIbUnERYywdCpZR0=; 7:H7PJr1OeGpSmRy53quuu5UBtm/THgzpz6ubWrHnHF58qtR9mG8TrVxg7A2kk0A3jllyJ2ayMMcJH8lyzzPYiNeUZTtLYSkCZAWTYJiAu7DeeRpEno+xf6vEHcXk2qrKtd7XcjNqEZlvAGVk113UK9wAKsiSLMcScadn6+gIW/qhvyvaAlaJ0qDuUG2AGU6KkHd2tzlxQ2A4OvgGuW2l8TT2UYQ6YJdMNA9DGo3+HrVtcK1SeHzTDqG5AW0SFgthI SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2017 23:02:39.1483 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b272fcde-9568-4a80-fd28-08d526fccf68 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.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3386 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.34.58 Subject: [Qemu-devel] [PATCH v4 36/45] hw/sparc*: Replace fprintf(stderr, "*\n" with error_report() 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: Mark Cave-Ayland , armbru@redhat.com, Fabien Chouteau , alistair.francis@xilinx.com, alistair23@gmail.com, Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Fabien Chouteau Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Reviewed-by: Philippe Mathieu-Daudé --- V2: - Split hw patch into individual directories hw/sparc/leon3.c | 16 +++++++--------- hw/sparc/sun4m.c | 16 +++++++--------- hw/sparc64/niagara.c | 4 ++-- hw/sparc64/sun4u.c | 10 +++++----- 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 8c66d5af24..bba3aa3dee 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -139,9 +140,8 @@ static void leon3_generic_hw_init(MachineState *machine) /* Allocate RAM */ if ((uint64_t)ram_size > (1UL << 30)) { - fprintf(stderr, - "qemu: Too much memory for this machine: %d, maximum 1G\n", - (unsigned int)(ram_size / (1024 * 1024))); + error_report("Too much memory for this machine: %d, maximum 1G", + (unsigned int)(ram_size / (1024 * 1024))); exit(1); } @@ -167,19 +167,18 @@ static void leon3_generic_hw_init(MachineState *machine) } if (bios_size > prom_size) { - fprintf(stderr, "qemu: could not load prom '%s': file too big\n", - filename); + error_report("could not load prom '%s': file too big", filename); exit(1); } if (bios_size > 0) { ret = load_image_targphys(filename, 0x00000000, bios_size); if (ret < 0 || ret > prom_size) { - fprintf(stderr, "qemu: could not load prom '%s'\n", filename); + error_report("could not load prom '%s'", filename); exit(1); } } else if (kernel_filename == NULL && !qtest_enabled()) { - fprintf(stderr, "Can't read bios image %s\n", filename); + error_report("Can't read bios image %s", filename); exit(1); } g_free(filename); @@ -192,8 +191,7 @@ static void leon3_generic_hw_init(MachineState *machine) kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, NULL, NULL, 1 /* big endian */, EM_SPARC, 0, 0); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } if (bios_size <= 0) { diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 24c2b8a555..e9e0ef0630 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -260,8 +260,7 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename, KERNEL_LOAD_ADDR, RAM_size - KERNEL_LOAD_ADDR); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } @@ -272,8 +271,8 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename, INITRD_LOAD_ADDR, RAM_size - INITRD_LOAD_ADDR); if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - initrd_filename); + error_report("could not load initial ram disk '%s'", + initrd_filename); exit(1); } } @@ -681,7 +680,7 @@ static void prom_init(hwaddr addr, const char *bios_name) ret = -1; } if (ret < 0 || ret > PROM_SIZE_MAX) { - fprintf(stderr, "qemu: could not load prom '%s'\n", bios_name); + error_report("could not load prom '%s'", bios_name); exit(1); } } @@ -747,10 +746,9 @@ static void ram_init(hwaddr addr, ram_addr_t RAM_size, /* allocate RAM */ if ((uint64_t)RAM_size > max_mem) { - fprintf(stderr, - "qemu: Too much memory for this machine: %d, maximum %d\n", - (unsigned int)(RAM_size / (1024 * 1024)), - (unsigned int)(max_mem / (1024 * 1024))); + error_report("Too much memory for this machine: %d, maximum %d", + (unsigned int)(RAM_size / (1024 * 1024)), + (unsigned int)(max_mem / (1024 * 1024))); exit(1); } dev = qdev_create(NULL, "memory"); diff --git a/hw/sparc64/niagara.c b/hw/sparc64/niagara.c index 7a723326c5..996ce2ada0 100644 --- a/hw/sparc64/niagara.c +++ b/hw/sparc64/niagara.c @@ -152,8 +152,8 @@ static void niagara_init(MachineState *machine) dinfo->is_default = 1; rom_add_file_fixed(blk_bs(blk)->filename, NIAGARA_VDISK_BASE, -1); } else { - fprintf(stderr, "qemu: could not load ram disk '%s'\n", - blk_bs(blk)->filename); + error_report("could not load ram disk '%s'", + blk_bs(blk)->filename); exit(1); } } diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 1672f256e7..1fd1c3c861 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -166,8 +167,7 @@ static uint64_t sun4u_load_kernel(const char *kernel_filename, RAM_size - KERNEL_LOAD_ADDR); } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } /* load initrd above kernel */ @@ -179,8 +179,8 @@ static uint64_t sun4u_load_kernel(const char *kernel_filename, *initrd_addr, RAM_size - *initrd_addr); if ((int)*initrd_size < 0) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - initrd_filename); + error_report("could not load initial ram disk '%s'", + initrd_filename); exit(1); } } @@ -327,7 +327,7 @@ static void prom_init(hwaddr addr, const char *bios_name) ret = -1; } if (ret < 0 || ret > PROM_SIZE_MAX) { - fprintf(stderr, "qemu: could not load prom '%s'\n", bios_name); + error_report("could not load prom '%s'", bios_name); exit(1); } }