From nobody Fri Dec 19 20:18:29 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1508430555251543.6391353694312; Thu, 19 Oct 2017 09:29:15 -0700 (PDT) Received: from localhost ([::1]:50105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dgz-0003Rb-Ao for importer@patchew.org; Thu, 19 Oct 2017 12:29:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYK-0004Cy-Rp for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYF-0000w8-AU for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:10 -0400 Received: from mail-bl2nam02on0078.outbound.protection.outlook.com ([104.47.38.78]:35264 helo=NAM02-BL2-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 1e5DY4-0000qk-Ka; Thu, 19 Oct 2017 12:19:56 -0400 Received: from BY2PR02CA0111.namprd02.prod.outlook.com (10.163.44.165) by MWHPR02MB3278.namprd02.prod.outlook.com (10.164.187.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Thu, 19 Oct 2017 16:19:52 +0000 Received: from CY1NAM02FT012.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::203) by BY2PR02CA0111.outlook.office365.com (2a01:111:e400:5261::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:19:52 +0000 Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT012.mail.protection.outlook.com (10.152.75.158) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:19:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35227 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXw-0007v2-9m; Thu, 19 Oct 2017 09:19:48 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DXw-0002R4-6o; Thu, 19 Oct 2017 09:19:48 -0700 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGJhmh003103; Thu, 19 Oct 2017 09:19:44 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXr-0002Qh-Nu; Thu, 19 Oct 2017 09:19:43 -0700 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=qbmFgprExjBMNU8/uMp2eNM1Sj7b+v/tyGcpi0pjc1M=; b=ExcADiy7wZWTHOwHeJlK3mi9xeE7XgQNkcv/QuYyXjjE9lhA4Vld9GEyGe17YGA837hc9T+X/Q7TZ5az00ofrJlt+/hro+OrDsDqyQJq+ywqcB80Bm8ry6+v3+x5S2ZniFw9rBo07m5TPlhreghOA1RSXRRGgGykcA4IyPVVfaA= Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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; From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:15:50 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.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)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(199003)(189002)(2906002)(50226002)(63266004)(356003)(81166006)(8936002)(106466001)(4326008)(575784001)(316002)(36386004)(47776003)(2351001)(33646002)(54906003)(39060400002)(16586007)(189998001)(478600001)(36756003)(6916009)(6666003)(2950100002)(50466002)(5660300001)(48376002)(118296001)(50986999)(5003940100001)(305945005)(8676002)(81156014)(76176999)(106002)(9786002)(53946003)(77096006)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB3278; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT012; 1:3sv1jZB6JSRscbHDUssDJbMREjFeAkJzYRkz0XmNHtqGZ+N2x+4kkKIRNJLZ+aux4LJtRUNe8QzUmyndHDt1J+Y7RwpA0dHzQSOmubzIdP7gizNt2NLyoJmbxIJCS+ew MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f91e48e1-0fc6-4951-8ffe-08d5170d38ae X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:MWHPR02MB3278; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3278; 3:PvwryKZqOb08NfWm5X2T07x1RhnBsTQysbmebIzCHQ8GdNq2D9JglUqLgXcPKmLzSCX5FEELSkITJT3MgtLLRLnaLjglYLdd3LZGySV8dIQKI4DqMp/8O2aI6nrCFRB40j+2/SJG0SYaP6m+ff6sj//NndeWDlsMtStihBYAgflNZ+s1+BEAMESITNljFEVfrHWLFdeHwWyFQaviITfWvvU50ftlR2iNiMwVJzlAMZ3G7OZmi/8T1XTzE8mxKpCw9/wufv2J6bhwFsHPMbRJo/TSeXbiZSU8YAQZqG8c2Q6mWEc4RQsmBUijiaOltg/6NlxNwSGO+Q7sbQkrT1saoC48D8zZjw05d6K6YGFTu04=; 25:BxDxR68jynPs8pAe3Nnk4fhE/Xn230K1HvukEG6WfEN1w7/eply7brs2K3uSQBq8E3rD6cIB/9Pck3mmxSR7phlXg4W+IEW27LDE8b3GzW5kbO41kE10S1gG06m+Pl26QXj+lk20viwoZzM+jVj9XFmFzWqVTh1pP6sEE4g6gqwJSUn+F5BxWJi0f/ZhxHfXvSnHzQxZ630P8LGcb7x/bXHXw8cVnuM3wmtU/a9hGszo3yoiHw1abqPygKMYSzCAkv1r5tr3GrcSMwvZ5OvN5jWbncy7RSPwj+QtQZjGROjRJNPMJOMCxi+QTn4TbqncPUkXn9zIXuHD2zWKlLs/hQ== X-MS-TrafficTypeDiagnostic: MWHPR02MB3278: X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3278; 31:lgkM8qbT0ZiW0BZUS6VbtxTfEyHgx0BPCO3zpX+mFUI1O4GFKfCjsawaEarKC8MW6N7QLTWo9Qc5BAIBqv/JbAP5hi+w5SHZ0s1eRIjjfog7veRn+3DWVOCBDVqx4HoljFnIOKivZ0xNHcB7QKwetd4Oze1j9di+faMN6pi4ikgAUJI3r3Iv82SpBcmM/enXfB4FY430mkNAnPVoUaQqw6p+1Hap1y3ck4RT5RuknbQ=; 20:TU41rHD6vCDnYtkNFmeRKdDkfp9XzmcQt0mGCvwU8FiWdbbjXQjVf1uS5ENspV61mMx3LnPaCQKb5zUd39S29psHsafw56mI+0aQgGckeYcSNVpDTc3ulO196iM/6KNA3pApPExZUPe5X1YM7bntzk0vTMJTLALK+3IXHxvDEtGgNdRNZ7FUobqXEnbaG+ola4B78Jxt2QQ3ueCa20FtpzPfqlk5ifzXcOIQEVpy7kv7QRakNxAjbldAz2Y5pqKTfCvKpvRfQ5kDFcTg47scp6CSeW3TlHCb3pJw+0vYy6D6if+byfvYvcx9RDywGC39fVvyQmulMdi0NtDCgwyW2VkUAFh2lCyuwTkkWq7cU2tcd/GuZ0fzKM/FYIxDCI7r2B1Px20/Jq2HRsOwL6ZUqtHHWaamPlyDy4qioMdnPhCTj5mLII9hmLSRPS6DxbG7Intn8DvcPTYxRX3+Mom7lKnx6edDkLIMStv6pYFBRWNPwB4bNqApjJgP/uIgJULC 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)(3002001)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR02MB3278; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR02MB3278; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3278; 4:bV/1cWYnghIE55C3WRghlwcQYZEfBk9W20s8si++d+sVAw+onTtUuLDnQS1iz++TriGZGxZ+K5mDusxS1Fs68/GibajWV7GwJXZcXVgSvs0GVmM8eRYP5Cooa2e1NXXM6xaJXwats1BUMHbYtXq24jbiPLVvNxDBkc2nhtFCqcCSIZPaN4mqJNNvz3jkYJugz6Xjh/brAR00cf2vs6trJZRfFn2VaGxEOWbV5NSFRBt0FxTBVYufU2CGGxX8RYj9zaYKOLe1DXkIBPV8gHVRxH5AN/rtqNnhbXfUFDHb9b2IMw1WLgixBMpRb1Rvw5zAYCqyUhJiGHlA8HotKywVSA== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR02MB3278; 23:U2mVOUsqr2yfYEpso3wwBowq/jFN4hKJyZFsB1L3C?= =?us-ascii?Q?nBGLVG1vcN8+E4x6c+043LAclJHv1zTRZva2jDQ1tlIpaC1XiqcCm5hNLx8Z?= =?us-ascii?Q?tiGk/mr+LaOcdCbs4DSpYX5M7SwG75gxudwc2M+PL0Nbs+AJRCsfbRRztJCo?= =?us-ascii?Q?pwYQKePGjSrfjyAPrQB/7t/WN68dtRywb8ihQKqF7424CRZhYNyE8bphUUtg?= =?us-ascii?Q?0fmDJt+R7X2ttvCC5v2y2qsTqNrON3rzROiiPny23O61IlMMgNsBnoec4RR/?= =?us-ascii?Q?wTfNJccLFBChrSZ18HwMU9arTMy+SVrkLDl8CyL4332EY6gkoEhTyHtEeWVF?= =?us-ascii?Q?VACb43qbma/PbCw1U1Nu2aAHZsTAHsIS2jvvNGlYXKp5Pkoo4xeD0FgJuUiC?= =?us-ascii?Q?qKDWxO2e4R0wptNIlDJzBqD3fOy9XGp37O6UDjq6A2nwsrjQAssrk+07S3s+?= =?us-ascii?Q?oEo5FrVaVEVrZP1cgiogzTwqLMjqdoSOfqIlnoTf50bi54OwJI2sHfarJLXR?= =?us-ascii?Q?IRFCmXRu/VZSp7g1mx5FbWK9RwhNd2WOVmmaSti8WY7zR/47EUxb9vIUmadI?= =?us-ascii?Q?24h+n53PtVXvsjLQFvqzw9DhIWgDl6pLCRIXsrC15D1zT4a2fxgKrJrfST3a?= =?us-ascii?Q?MlZ9maJYzY9bcsISdwLj1mFYo1PxT2auM8fTdtsu3fI9nWh49wa3p6/VQbPB?= =?us-ascii?Q?mUdH6diomhDhw9FA/UCuTPhOhoTOM+vS3Us55DR/XR6gvh6+o0DKaE9TawHt?= =?us-ascii?Q?JCY0pdjj+Q6odiJFGyzSANLpfDdG3gwK6MLKrUPwPTir++yp7luRgjmmrxGX?= =?us-ascii?Q?ZVdO3yz4JOnopH62HZ/Kw30COYncPoUncJzY7UhI+BWmUyY6ZHw6ac33Z8fg?= =?us-ascii?Q?f5pfWBRU+gJte9sa9vNZtJCBJU27MB1RXbBnmZjrRly0TYdkh+wNvttQwb3p?= =?us-ascii?Q?B9/56PdbQHYYOBcWt14N/m8Wo4dL7Pp+A1dDeOsONmc4jX0oBy8NMPqzzQuh?= =?us-ascii?Q?hRfBEU9/Lpwr6E0esS+Y0/A8t6NboqierimDyb+motnMu1vLEHttPVJHsOjM?= =?us-ascii?Q?OGHDMgruJiR4GpsbhNanr+ceZNhisNKzgj5XBZBJnSA7SDWeE1aA7FIrwQ5U?= =?us-ascii?Q?uqaWFP6Ysw=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3278; 6:iKc/12rehIUXWtuxJTtcVA8cZMY6wuGTLDbWuH7ZgB4SE4MDTrfRJY0MFfcpcMqiyZUtpggtkD7yemCHHeYVBlHBoW9ZBYJ5TEgTILSCknnLdlNo5yo1MCYR6RXNf9dmWtJoMl7lcp/j5iz/RCcbc+J964shmU0XpdyvceqYvVGfqa0AapEnkQ+qPMSJJN9sp3hREnjBa1Pr4IBm3td7NKkbuS6pTE8rJaSLn7KS4kLGPQnyHEHQSOI0AB8EAiM1SWXRxAZHQIgFLvxtCDY/jmYtOAWSZAKzymbgao1OAUGgB4IHCXrKCLA4oCHug5Ow2Y425SdnbyWUS4rwZub9zw==; 5:YCOYup1yNO1dkiCqKnTrnuJbJ15V26CFbRnaRFQszU2LT32kK3BeFuAemsFSPKNSrhXCAREHH+0qmJoBR0M9nRerIkTicZgZY7zjzE25breFtdE0sABKDgy1LaDLlyGl62r2fwmJ7INePfqRT73DtQ==; 24:TbK0uSZtyNpMkWQ2//RdaN8VZ++Vr8qc8J8Kr/vpNbb03/rLOHzDLddGJxrPqKGiLT4r7x9v2o9dGqt2Q2oY+SW/Z/RPfxJKKKTh12hnE2E=; 7:uf5gWGFszKX8SDUQUz0fLkR+hP+wpE1LSJ7wiyo2QnSIstVD3jD8gVurYXXVY8ywMplJDBiQBPjqHw2DngOSQBEnt/AVmgiCmtT6CIgeO4qbfX0eMq+QvCpP34Jal5Ph6qkWcGwI1O2aOvbvjBfCg7mIitTN6Z/2Qja9OWyY2FzKgS67Jn71P7gsAIG+7ZRiP51BYqNcu3zlTaxe81EBTXQrEsYG2whQDTOTTp0z860= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:19:48.9208 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f91e48e1-0fc6-4951-8ffe-08d5170d38ae 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: MWHPR02MB3278 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.78 Subject: [Qemu-devel] [PATCH v3 04/46] tests: 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: qemu-block@nongnu.org, "Michael S. Tsirkin" , armbru@redhat.com, "Dr. David Alan Gilbert" , Gerd Hoffmann , Igor Mammedov , alistair23@gmail.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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_re= port("\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 of the error_report()'s were manually kept as fprintf(stderr, ) to maintain standalone test cases. Signed-off-by: Alistair Francis Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: "Dr. David Alan Gilbert" Cc: Gerd Hoffmann Cc: qemu-block@nongnu.org --- V2: - Keep some of the fprintf() calls - Remove a file I accidently checked in tests/Makefile.include | 4 ++-- tests/ahci-test.c | 3 ++- tests/bios-tables-test.c | 5 +++-- tests/i440fx-test.c | 8 ++++---- tests/libqos/ahci.c | 10 +++++----- tests/libqos/libqos.c | 7 ++++--- tests/libqos/malloc.c | 13 ++++++------ tests/libqtest.c | 13 ++++++------ tests/migration/stress.c | 36 +++++++++++++++++-------------= ---- tests/postcopy-test.c | 8 ++++---- tests/qemu-iotests/socket_scm_helper.c | 11 ++++++----- tests/rcutorture.c | 5 +++-- tests/tcg/linux-test.c | 2 +- tests/tcg/runcom.c | 6 +++--- tests/tcg/test-i386-fprem.c | 2 +- tests/tcg/test_path.c | 4 ++-- tests/test-hmp.c | 5 +++-- tests/test-rcu-list.c | 5 +++-- tests/usb-hcd-ehci-test.c | 2 +- tests/vhost-user-bridge.c | 28 +++++++++++++------------- 20 files changed, 93 insertions(+), 84 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 4ca15e6817..f24ea63ac3 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -618,7 +618,7 @@ tests/test-vmstate$(EXESUF): tests/test-vmstate.o \ $(test-io-obj-y) tests/test-timed-average$(EXESUF): tests/test-timed-average.o $(test-util-= obj-y) tests/test-base64$(EXESUF): tests/test-base64.o $(test-util-obj-y) -tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o = hw/core/ptimer.o +tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o = hw/core/ptimer.o $(test-util-obj-y) =20 tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y) =20 @@ -785,7 +785,7 @@ tests/postcopy-test$(EXESUF): tests/postcopy-test.o tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o $(test-util-obj-y)= \ $(qtest-obj-y) $(test-io-obj-y) $(libqos-virtio-obj-y) $(libqos-pc-obj-y)= \ $(chardev-obj-y) -tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_s= cm_helper.o +tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_s= cm_helper.o $(test-util-obj-y) tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o $(test-util-obj-y) tests/test-keyval$(EXESUF): tests/test-keyval.o $(test-util-obj-y) $(test-= qapi-obj-y) tests/test-write-threshold$(EXESUF): tests/test-write-threshold.o $(test-b= lock-obj-y) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index cb84edc8fb..ac8a30ab8b 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include =20 #include "libqtest.h" @@ -1859,7 +1860,7 @@ int main(int argc, char **argv) ahci_pedantic =3D 1; break; default: - fprintf(stderr, "Unrecognized ahci_test option.\n"); + error_report("Unrecognized ahci_test option."); g_assert_not_reached(); } } diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 564da45f65..0955c72a74 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -11,6 +11,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include #include "qemu-common.h" #include "hw/smbios/smbios.h" @@ -396,7 +397,7 @@ try_again: aml_file =3D g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machi= ne, (gchar *)&signature, ext); if (getenv("V")) { - fprintf(stderr, "\nLooking for expected file '%s'\n", aml_file= ); + error_report("Looking for expected file '%s'", aml_file); } if (g_file_test(aml_file, G_FILE_TEST_EXISTS)) { exp_sdt.aml_file =3D aml_file; @@ -408,7 +409,7 @@ try_again: } g_assert(exp_sdt.aml_file); if (getenv("V")) { - fprintf(stderr, "\nUsing expected file '%s'\n", aml_file); + error_report("Using expected file '%s'", aml_file); } ret =3D g_file_get_contents(aml_file, &exp_sdt.aml, &exp_sdt.aml_len, &error); diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c index e9d05c87d1..75fb9742ce 100644 --- a/tests/i440fx-test.c +++ b/tests/i440fx-test.c @@ -13,7 +13,7 @@ */ =20 #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "libqtest.h" #include "libqos/pci.h" #include "libqos/pci-pc.h" @@ -295,18 +295,18 @@ static char *create_blob_file(void) ret =3D -1; fd =3D g_file_open_tmp("blob_XXXXXX", &pathname, &error); if (fd =3D=3D -1) { - fprintf(stderr, "unable to create blob file: %s\n", error->message= ); + error_report("unable to create blob file: %s", error->message); g_error_free(error); } else { if (ftruncate(fd, BLOB_SIZE) =3D=3D -1) { - fprintf(stderr, "ftruncate(\"%s\", %zu): %s\n", pathname, + error_report("ftruncate(\"%s\", %zu): %s", pathname, BLOB_SIZE, strerror(errno)); } else { void *buf; =20 buf =3D mmap(NULL, BLOB_SIZE, PROT_WRITE, MAP_SHARED, fd, 0); if (buf =3D=3D MAP_FAILED) { - fprintf(stderr, "mmap(\"%s\", %zu): %s\n", pathname, BLOB_= SIZE, + error_report("mmap(\"%s\", %zu): %s", pathname, BLOB_SIZE, strerror(errno)); } else { size_t i; diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 13c0749582..286f5c3e64 100644 --- a/tests/libqos/ahci.c +++ b/tests/libqos/ahci.c @@ -23,7 +23,7 @@ */ =20 #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "libqtest.h" #include "libqos/ahci.h" #include "libqos/pci-pc.h" @@ -985,9 +985,9 @@ static void ahci_atapi_command_set_offset(AHCICommand *= cmd, uint64_t lba) default: /* SCSI doesn't have uniform packet formats, * so you have to add support for it manually. Sorry! */ - fprintf(stderr, "The Libqos AHCI driver does not support the " + error_report("The Libqos AHCI driver does not support the " "set_offset operation for ATAPI command 0x%02x, " - "please add support.\n", + "please add support.", cbd[0]); g_assert_not_reached(); } @@ -1060,8 +1060,8 @@ static void ahci_atapi_set_size(AHCICommand *cmd, uin= t64_t xbytes) default: /* SCSI doesn't have uniform packet formats, * so you have to add support for it manually. Sorry! */ - fprintf(stderr, "The Libqos AHCI driver does not support the set_s= ize " - "operation for ATAPI command 0x%02x, please add support.\n= ", + error_report("The Libqos AHCI driver does not support the set_size= " + "operation for ATAPI command 0x%02x, please add support.", cbd[0]); g_assert_not_reached(); } diff --git a/tests/libqos/libqos.c b/tests/libqos/libqos.c index 991bc1aec2..c84ffb6925 100644 --- a/tests/libqos/libqos.c +++ b/tests/libqos/libqos.c @@ -1,4 +1,5 @@ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include =20 #include "libqtest.h" @@ -155,7 +156,7 @@ void migrate(QOSState *from, QOSState *to, const char *= uri) continue; } =20 - fprintf(stderr, "Migration did not complete, status: %s\n", st); + error_report("Migration did not complete, status: %s", st); g_assert_not_reached(); } =20 @@ -199,7 +200,7 @@ void mkimg(const char *file, const char *fmt, unsigned = size_mb) fmt, file, size_mb); ret =3D g_spawn_command_line_sync(cli, &out, &out2, &rc, &err); if (err) { - fprintf(stderr, "%s\n", err->message); + error_report("%s", err->message); g_error_free(err); } g_assert(ret && !err); @@ -210,7 +211,7 @@ void mkimg(const char *file, const char *fmt, unsigned = size_mb) * 0 is only possible if the program exited normally, so that should be * sufficient for our purposes on all platforms, here. */ if (rc) { - fprintf(stderr, "qemu-img returned status code %d\n", rc); + error_report("qemu-img returned status code %d", rc); } g_assert(!rc); =20 diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c index ac05874b0a..a655a25f1f 100644 --- a/tests/libqos/malloc.c +++ b/tests/libqos/malloc.c @@ -11,6 +11,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "libqos/malloc.h" #include "qemu-common.h" #include "qemu/host-utils.h" @@ -193,7 +194,7 @@ static uint64_t mlist_alloc(QGuestAllocator *s, uint64_= t size) =20 node =3D mlist_find_space(s->free, size); if (!node) { - fprintf(stderr, "Out of guest memory.\n"); + error_report("Out of guest memory."); g_assert_not_reached(); } return mlist_fulfill(s, node, size); @@ -209,8 +210,8 @@ static void mlist_free(QGuestAllocator *s, uint64_t add= r) =20 node =3D mlist_find_key(s->used, addr); if (!node) { - fprintf(stderr, "Error: no record found for an allocation at " - "0x%016" PRIx64 ".\n", + error_report("Error: no record found for an allocation at " + "0x%016" PRIx64 ".", addr); g_assert_not_reached(); } @@ -234,8 +235,8 @@ void alloc_uninit(QGuestAllocator *allocator) /* Check for guest leaks, and destroy the list. */ QTAILQ_FOREACH_SAFE(node, allocator->used, MLIST_ENTNAME, tmp) { if (allocator->opts & (ALLOC_LEAK_WARN | ALLOC_LEAK_ASSERT)) { - fprintf(stderr, "guest malloc leak @ 0x%016" PRIx64 "; " - "size 0x%016" PRIx64 ".\n", + error_report("guest malloc leak @ 0x%016" PRIx64 "; " + "size 0x%016" PRIx64 ".", node->addr, node->size); } if (allocator->opts & (ALLOC_LEAK_ASSERT)) { @@ -251,7 +252,7 @@ void alloc_uninit(QGuestAllocator *allocator) if ((allocator->opts & mask) =3D=3D mask) { if ((node->addr !=3D allocator->start) || (node->size !=3D allocator->end - allocator->start)) { - fprintf(stderr, "Free list is corrupted.\n"); + error_report("Free list is corrupted."); g_assert_not_reached(); } } diff --git a/tests/libqtest.c b/tests/libqtest.c index adf71188b6..936ace03c9 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -15,6 +15,7 @@ * */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "libqtest.h" =20 #include @@ -89,7 +90,7 @@ static int socket_accept(int sock) ret =3D accept(sock, (struct sockaddr *)&addr, &addrlen); } while (ret =3D=3D -1 && errno =3D=3D EINTR); if (ret =3D=3D -1) { - fprintf(stderr, "%s failed: %s\n", __func__, strerror(errno)); + error_report("%s failed: %s", __func__, strerror(errno)); } close(sock); =20 @@ -155,7 +156,7 @@ static const char *qtest_qemu_binary(void) =20 qemu_bin =3D getenv("QTEST_QEMU_BINARY"); if (!qemu_bin) { - fprintf(stderr, "Environment variable QTEST_QEMU_BINARY required\n= "); + error_report("Environment variable QTEST_QEMU_BINARY required"); exit(1); } =20 @@ -312,7 +313,7 @@ static GString *qtest_recv_line(QTestState *s) } =20 if (len =3D=3D -1 || len =3D=3D 0) { - fprintf(stderr, "Broken pipe\n"); + error_report("Broken pipe"); exit(1); } =20 @@ -397,7 +398,7 @@ static void qmp_response(JSONMessageParser *parser, GQu= eue *tokens) =20 obj =3D json_parser_parse(tokens, NULL); if (!obj) { - fprintf(stderr, "QMP JSON response parsing failed\n"); + error_report("QMP JSON response parsing failed"); exit(1); } =20 @@ -423,7 +424,7 @@ QDict *qmp_fd_receive(int fd) } =20 if (len =3D=3D -1 || len =3D=3D 0) { - fprintf(stderr, "Broken pipe\n"); + error_report("Broken pipe"); exit(1); } =20 @@ -880,7 +881,7 @@ void qtest_bufread(QTestState *s, uint64_t addr, void *= data, size_t size) =20 g_base64_decode_inplace(args[1], &len); if (size !=3D len) { - fprintf(stderr, "bufread: asked for %zu bytes but decoded %zu\n", + error_report("bufread: asked for %zu bytes but decoded %zu", size, len); len =3D MIN(len, size); } diff --git a/tests/migration/stress.c b/tests/migration/stress.c index cf8ce8b16d..49e1ff4555 100644 --- a/tests/migration/stress.c +++ b/tests/migration/stress.c @@ -47,7 +47,7 @@ static __attribute__((noreturn)) void exit_failure(void) if (getpid() =3D=3D 1) { sync(); reboot(RB_POWER_OFF); - fprintf(stderr, "%s (%05d): ERROR: cannot reboot: %s\n", + error_report("%s (%05d): cannot reboot: %s", argv0, gettid(), strerror(errno)); abort(); } else { @@ -60,7 +60,7 @@ static __attribute__((noreturn)) void exit_success(void) if (getpid() =3D=3D 1) { sync(); reboot(RB_POWER_OFF); - fprintf(stderr, "%s (%05d): ERROR: cannot reboot: %s\n", + error_report("%s (%05d): cannot reboot: %s", argv0, gettid(), strerror(errno)); abort(); } else { @@ -76,13 +76,13 @@ static int get_command_arg_str(const char *name, char *start, *end; =20 if (fp =3D=3D NULL) { - fprintf(stderr, "%s (%05d): ERROR: cannot open /proc/cmdline: %s\n= ", + error_report("%s (%05d): cannot open /proc/cmdline: %s", argv0, gettid(), strerror(errno)); return -1; } =20 if (!fgets(line, sizeof line, fp)) { - fprintf(stderr, "%s (%05d): ERROR: cannot read /proc/cmdline: %s\n= ", + error_report("%s (%05d): cannot read /proc/cmdline: %s", argv0, gettid(), strerror(errno)); fclose(fp); return -1; @@ -96,8 +96,8 @@ static int get_command_arg_str(const char *name, start +=3D strlen(name); =20 if (*start !=3D '=3D') { - fprintf(stderr, "%s (%05d): ERROR: no value provided for '%s' in /= proc/cmdline\n", - argv0, gettid(), name); + error_report("%s (%05d): no value provided for '%s' in /proc/cmdli= ne", + argv0, gettid(), name); } start++; =20 @@ -106,8 +106,8 @@ static int get_command_arg_str(const char *name, end =3D strstr(start, "\n"); =20 if (end =3D=3D start) { - fprintf(stderr, "%s (%05d): ERROR: no value provided for '%s' in /= proc/cmdline\n", - argv0, gettid(), name); + error_report("%s (%05d): no value provided for '%s' in /proc/cmdli= ne", + argv0, gettid(), name); return -1; } =20 @@ -132,7 +132,7 @@ static int get_command_arg_ull(const char *name, errno =3D 0; *val =3D strtoll(valstr, &end, 10); if (errno || *end) { - fprintf(stderr, "%s (%05d): ERROR: cannot parse %s value %s\n", + error_report("%s (%05d): cannot parse %s value %s", argv0, gettid(), name, valstr); free(valstr); return -1; @@ -148,13 +148,13 @@ static int random_bytes(char *buf, size_t len) =20 fd =3D open("/dev/urandom", O_RDONLY); if (fd < 0) { - fprintf(stderr, "%s (%05d): ERROR: cannot open /dev/urandom: %s\n", + error_report("%s (%05d): cannot open /dev/urandom: %s", argv0, gettid(), strerror(errno)); return -1; } =20 if (read(fd, buf, len) !=3D len) { - fprintf(stderr, "%s (%05d): ERROR: cannot read /dev/urandom: %s\n", + error_report("%s (%05d): cannot read /dev/urandom: %s", argv0, gettid(), strerror(errno)); close(fd); return -1; @@ -187,12 +187,12 @@ static int stressone(unsigned long long ramsizeMB) unsigned long long before, after; =20 if (!ram) { - fprintf(stderr, "%s (%05d): ERROR: cannot allocate %llu MB of RAM:= %s\n", + error_report("%s (%05d): cannot allocate %llu MB of RAM: %s", argv0, gettid(), ramsizeMB, strerror(errno)); return -1; } if (!data) { - fprintf(stderr, "%s (%d): ERROR: cannot allocate %d bytes of RAM: = %s\n", + error_report("%s (%d): cannot allocate %d bytes of RAM: %s", argv0, gettid(), PAGE_SIZE, strerror(errno)); free(ram); return -1; @@ -271,13 +271,13 @@ static int stress(unsigned long long ramsizeGB, int n= cpus) static int mount_misc(const char *fstype, const char *dir) { if (mkdir(dir, 0755) < 0 && errno !=3D EEXIST) { - fprintf(stderr, "%s (%05d): ERROR: cannot create %s: %s\n", + error_report("%s (%05d): cannot create %s: %s", argv0, gettid(), dir, strerror(errno)); return -1; } =20 if (mount("none", dir, fstype, 0, NULL) < 0) { - fprintf(stderr, "%s (%05d): ERROR: cannot mount %s: %s\n", + error_report("%s (%05d): cannot mount %s: %s", argv0, gettid(), dir, strerror(errno)); return -1; } @@ -322,7 +322,7 @@ int main(int argc, char **argv) errno =3D 0; ramsizeGB =3D strtoll(optarg, &end, 10); if (errno !=3D 0 || *end) { - fprintf(stderr, "%s (%05d): ERROR: Cannot parse RAM size %= s\n", + error_report("%s (%05d): Cannot parse RAM size %s", argv0, gettid(), optarg); exit_failure(); } @@ -332,7 +332,7 @@ int main(int argc, char **argv) errno =3D 0; ncpus =3D strtoll(optarg, &end, 10); if (errno !=3D 0 || *end) { - fprintf(stderr, "%s (%05d): ERROR: Cannot parse CPU count = %s\n", + error_report("%s (%05d): Cannot parse CPU count %s", argv0, gettid(), optarg); exit_failure(); } @@ -340,7 +340,7 @@ int main(int argc, char **argv) =20 case '?': case 'h': - fprintf(stderr, "%s: [--help][--ramsize GB][--cpus N]\n", argv= 0); + error_report("%s: [--help][--ramsize GB][--cpus N]", argv0); exit_failure(); } } diff --git a/tests/postcopy-test.c b/tests/postcopy-test.c index 8142f2ab90..32bb11ba82 100644 --- a/tests/postcopy-test.c +++ b/tests/postcopy-test.c @@ -11,7 +11,7 @@ */ =20 #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "libqtest.h" #include "qemu/option.h" #include "qemu/range.h" @@ -214,7 +214,7 @@ static void wait_for_serial(const char *side) break; =20 default: - fprintf(stderr, "Unexpected %d on %s serial\n", readvalue, sid= e); + error_report("Unexpected %d on %s serial", readvalue, side); g_assert_not_reached(); } } while (true); @@ -333,9 +333,9 @@ static void check_guests_ram(void) */ hit_edge =3D true; } else { - fprintf(stderr, "Memory content inconsistency at %x" + error_report("Memory content inconsistency at %x" " first_byte =3D %x last_byte =3D %x curre= nt =3D %x" - " hit_edge =3D %x\n", + " hit_edge =3D %x", address, first_byte, last_byte, b, hit_edg= e); bad =3D true; } diff --git a/tests/qemu-iotests/socket_scm_helper.c b/tests/qemu-iotests/so= cket_scm_helper.c index eb76d31aa9..7785da953a 100644 --- a/tests/qemu-iotests/socket_scm_helper.c +++ b/tests/qemu-iotests/socket_scm_helper.c @@ -11,6 +11,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include #include =20 @@ -53,7 +54,7 @@ static int send_fd(int fd, int fd_to_send) } while (ret < 0 && errno =3D=3D EINTR); =20 if (ret < 0) { - fprintf(stderr, "Failed to send msg, reason: %s\n", strerror(errno= )); + error_report("Failed to send msg, reason: %s", strerror(errno)); } =20 return ret; @@ -69,14 +70,14 @@ static int get_fd_num(const char *fd_str, bool silent) sock =3D strtol(fd_str, &err, 10); if (errno) { if (!silent) { - fprintf(stderr, "Failed in strtol for socket fd, reason: %s\n", + error_report("Failed in strtol for socket fd, reason: %s", strerror(errno)); } return -1; } if (!*fd_str || *err || sock < 0) { if (!silent) { - fprintf(stderr, "bad numerical value for socket fd '%s'\n", fd= _str); + error_report("bad numerical value for socket fd '%s'", fd_str); } return -1; } @@ -96,7 +97,7 @@ int main(int argc, char **argv, char **envp) #ifdef SOCKET_SCM_DEBUG int i; for (i =3D 0; i < argc; i++) { - fprintf(stderr, "Parameter %d: %s\n", i, argv[i]); + error_report("Parameter %d: %s", i, argv[i]); } #endif =20 @@ -120,7 +121,7 @@ int main(int argc, char **argv, char **envp) is supposed to fork and exec this program. */ fd =3D open(argv[2], O_RDONLY); if (fd < 0) { - fprintf(stderr, "Failed to open file '%s'\n", argv[2]); + error_report("Failed to open file '%s'", argv[2]); return EXIT_FAILURE; } } diff --git a/tests/rcutorture.c b/tests/rcutorture.c index 4002ecf123..21d2c76d0b 100644 --- a/tests/rcutorture.c +++ b/tests/rcutorture.c @@ -61,6 +61,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/atomic.h" #include "qemu/rcu.h" #include "qemu/thread.h" @@ -86,7 +87,7 @@ static int n_threads; static void create_thread(void *(*func)(void *)) { if (n_threads >=3D NR_THREADS) { - fprintf(stderr, "Thread limit of %d exceeded!\n", NR_THREADS); + error_report("Thread limit of %d exceeded!", NR_THREADS); exit(-1); } qemu_thread_create(&threads[n_threads], "test", func, &data[n_threads], @@ -417,7 +418,7 @@ static void gtest_stress_10_5(void) =20 static void usage(int argc, char *argv[]) { - fprintf(stderr, "Usage: %s [nreaders [ perf | stress ] ]\n", argv[0]); + error_report("Usage: %s [nreaders [ perf | stress ] ]", argv[0]); exit(-1); } =20 diff --git a/tests/tcg/linux-test.c b/tests/tcg/linux-test.c index 5070d31446..76c9059073 100644 --- a/tests/tcg/linux-test.c +++ b/tests/tcg/linux-test.c @@ -51,7 +51,7 @@ void error1(const char *filename, int line, const char *f= mt, ...) va_start(ap, fmt); fprintf(stderr, "%s:%d: ", filename, line); vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); + error_report(""); va_end(ap); exit(1); } diff --git a/tests/tcg/runcom.c b/tests/tcg/runcom.c index d60342bfc6..7acf0239c8 100644 --- a/tests/tcg/runcom.c +++ b/tests/tcg/runcom.c @@ -61,7 +61,7 @@ void dump_regs(struct vm86_regs *r) #ifdef SIGTEST void alarm_handler(int sig) { - fprintf(stderr, "alarm signal=3D%d\n", sig); + error_report("alarm signal=3D%d", sig); alarm(1); } #endif @@ -172,7 +172,7 @@ int main(int argc, char **argv) break; default: unknown_int: - fprintf(stderr, "unsupported int 0x%02x\n", int_num); + error_report("unsupported int 0x%02x", int_num); dump_regs(&ctx.regs); // exit(1); } @@ -184,7 +184,7 @@ int main(int argc, char **argv) case VM86_STI: break; default: - fprintf(stderr, "unhandled vm86 return code (0x%x)\n", ret); + error_report("unhandled vm86 return code (0x%x)", ret); dump_regs(&ctx.regs); exit(1); } diff --git a/tests/tcg/test-i386-fprem.c b/tests/tcg/test-i386-fprem.c index 1a71623204..7c3d37d07a 100644 --- a/tests/tcg/test-i386-fprem.c +++ b/tests/tcg/test-i386-fprem.c @@ -340,7 +340,7 @@ static void test_fprem_pairs(void) } } =20 - fprintf(stderr, "test-i386-fprem: tested %llu cases\n", count); + error_report("test-i386-fprem: tested %llu cases", count); } =20 int main(int argc, char **argv) diff --git a/tests/tcg/test_path.c b/tests/tcg/test_path.c index 1c29bce263..d543bb76ef 100644 --- a/tests/tcg/test_path.c +++ b/tests/tcg/test_path.c @@ -150,8 +150,8 @@ int main(int argc, char *argv[]) ret =3D do_test(); cleanup(); if (ret) { - fprintf(stderr, "test_path: failed on line %i\n", ret); - return 1; + error_report("test_path: failed on line %i", ret); + return 1; } return 0; } diff --git a/tests/test-hmp.c b/tests/test-hmp.c index 5677fbf775..ff86220814 100644 --- a/tests/test-hmp.c +++ b/tests/test-hmp.c @@ -15,6 +15,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "libqtest.h" =20 static int verbose; @@ -79,7 +80,7 @@ static void test_commands(void) =20 for (i =3D 0; hmp_cmds[i] !=3D NULL; i++) { if (verbose) { - fprintf(stderr, "\t%s\n", hmp_cmds[i]); + error_report("\t%s", hmp_cmds[i]); } response =3D hmp("%s", hmp_cmds[i]); g_free(response); @@ -102,7 +103,7 @@ static void test_info_commands(void) *endp =3D '\0'; /* Now run the info command */ if (verbose) { - fprintf(stderr, "\t%s\n", info); + error_report("\t%s", info); } resp =3D hmp("%s", info); g_free(resp); diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c index 1514d7ec97..00a03de370 100644 --- a/tests/test-rcu-list.c +++ b/tests/test-rcu-list.c @@ -21,6 +21,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/atomic.h" #include "qemu/rcu.h" #include "qemu/thread.h" @@ -64,7 +65,7 @@ static int select_random_el(int max) static void create_thread(void *(*func)(void *)) { if (n_threads >=3D NR_THREADS) { - fprintf(stderr, "Thread limit of %d exceeded!\n", NR_THREADS); + error_report("Thread limit of %d exceeded!", NR_THREADS); exit(-1); } qemu_thread_create(&threads[n_threads], "test", func, &data[n_threads], @@ -255,7 +256,7 @@ static void rcu_qtest(const char *test, int duration, i= nt nreaders) =20 static void usage(int argc, char *argv[]) { - fprintf(stderr, "Usage: %s duration nreaders\n", argv[0]); + error_report("Usage: %s duration nreaders", argv[0]); exit(-1); } =20 diff --git a/tests/usb-hcd-ehci-test.c b/tests/usb-hcd-ehci-test.c index 944eb1c088..1e7ef842e5 100644 --- a/tests/usb-hcd-ehci-test.c +++ b/tests/usb-hcd-ehci-test.c @@ -42,7 +42,7 @@ static void ehci_port_test(struct qhc *hc, int port, uint= 32_t expect) uint16_t mask =3D ~(PORTSC_CSC | PORTSC_PEDC | PORTSC_OCC); =20 #if 0 - fprintf(stderr, "%s: %d, have 0x%08x, want 0x%08x\n", + error_report("%s: %d, have 0x%08x, want 0x%08x", __func__, port, value & mask, expect & mask); #endif g_assert((value & mask) =3D=3D (expect & mask)); diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index d820033a72..31a884e0da 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -181,7 +181,7 @@ vubr_handle_tx(VuDev *dev, int qidx) out_num =3D elem->out_num; out_sg =3D elem->out_sg; if (out_num < 1) { - fprintf(stderr, "virtio-net header not in first element\n"); + error_report("virtio-net header not in first element"); break; } if (VHOST_USER_BRIDGE_DEBUG) { @@ -294,7 +294,7 @@ vubr_backend_recv_cb(int sock, void *ctx) } =20 if (elem->in_num < 1) { - fprintf(stderr, "virtio-net contains no in buffers\n"); + error_report("virtio-net contains no in buffers"); break; } =20 @@ -364,7 +364,7 @@ vubr_receive_cb(int sock, void *ctx) VubrDev *vubr =3D (VubrDev *)ctx; =20 if (!vu_dispatch(&vubr->vudev)) { - fprintf(stderr, "Error while dispatching\n"); + error_report("Error while dispatching"); } } =20 @@ -461,7 +461,7 @@ vubr_panic(VuDev *dev, const char *msg) { VubrDev *vubr =3D container_of(dev, VubrDev, vudev); =20 - fprintf(stderr, "PANIC: %s\n", msg); + error_report("PANIC: %s", msg); =20 dispatcher_remove(&vubr->dispatcher, dev->sock); vubr->quit =3D 1; @@ -562,14 +562,14 @@ vubr_set_host(struct sockaddr_in *saddr, const char *= host) { if (isdigit(host[0])) { if (!inet_aton(host, &saddr->sin_addr)) { - fprintf(stderr, "inet_aton() failed.\n"); + error_report("inet_aton() failed."); exit(1); } } else { struct hostent *he =3D gethostbyname(host); =20 if (!he) { - fprintf(stderr, "gethostbyname() failed.\n"); + error_report("gethostbyname() failed."); exit(1); } saddr->sin_addr =3D *(struct in_addr *)he->h_addr; @@ -590,13 +590,13 @@ vubr_backend_udp_setup(VubrDev *dev, =20 lport =3D strtol(local_port, (char **)&r, 0); if (r =3D=3D local_port) { - fprintf(stderr, "lport parsing failed.\n"); + error_report("lport parsing failed."); exit(1); } =20 rport =3D strtol(remote_port, (char **)&r, 0); if (r =3D=3D remote_port) { - fprintf(stderr, "rport parsing failed.\n"); + error_report("rport parsing failed."); exit(1); } =20 @@ -714,15 +714,15 @@ main(int argc, char *argv[]) return 0; =20 out: - fprintf(stderr, "Usage: %s ", argv[0]); - fprintf(stderr, "[-c] [-u ud_socket_path] [-l lhost:lport] [-r rhost:r= port]\n"); - fprintf(stderr, "\t-u path to unix doman socket. default: %s\n", + error_report("Usage: %s ", argv[0]); + error_report("[-c] [-u ud_socket_path] [-l lhost:lport] [-r rhost:rpor= t]"); + error_report("\t-u path to unix doman socket. default: %s", DEFAULT_UD_SOCKET); - fprintf(stderr, "\t-l local host and port. default: %s:%s\n", + fprintf(stderr, "\t-l local host and port. default: %s:%s", DEFAULT_LHOST, DEFAULT_LPORT); - fprintf(stderr, "\t-r remote host and port. default: %s:%s\n", + error_report("\t-r remote host and port. default: %s:%s", DEFAULT_RHOST, DEFAULT_RPORT); - fprintf(stderr, "\t-c client mode\n"); + error_report("\t-c client mode"); =20 return 1; } --=20 2.11.0