From patchwork Wed Nov 8 22:56:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 836037 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="VOG/s0eI"; 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 3yXMLZ5gSYz9s72 for ; Thu, 9 Nov 2017 10:04:22 +1100 (AEDT) Received: from localhost ([::1]:34313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCZOO-0001Pq-Qf for incoming@patchwork.ozlabs.org; Wed, 08 Nov 2017 18:04:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCZL7-0007Xe-Fb for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:01:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCZL4-0002y9-3b for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:00:57 -0500 Received: from mail-sn1nam01on0074.outbound.protection.outlook.com ([104.47.32.74]:1834 helo=NAM01-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 1eCZKw-0002rW-JN; Wed, 08 Nov 2017 18:00:46 -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=9wtCPf/J7PbtQK8poQBL6jLey92lNwr/YFNvh+ryvcc=; b=VOG/s0eIwEoFMNO/iPjZtKOxsKbpTFI/CAdqWTNvNIUYCa6x7TG0NPDq1ybwzE8JHplz7zZTlwmgBir2l+l8PjR+xy4Xg13R3gZPqbhSGZaFZ6PBfDjmS2utUSEVVWgFDQIoXue5p4copFWLg7GaPN/zmlKXuKnZPLSimXBafjs= Received: from BN6PR02CA0082.namprd02.prod.outlook.com (10.161.158.23) by MWHPR02MB3391.namprd02.prod.outlook.com (10.164.192.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Wed, 8 Nov 2017 23:00:42 +0000 Received: from CY1NAM02FT021.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by BN6PR02CA0082.outlook.office365.com (2603:10b6:405:60::23) 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:00:41 +0000 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 CY1NAM02FT021.mail.protection.outlook.com (10.152.75.187) 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:00:40 +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 1eCZKq-0001KP-6G; Wed, 08 Nov 2017 15:00:40 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1eCZKq-0002E8-31; Wed, 08 Nov 2017 15:00:40 -0800 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id vA8N0ZbA008349; Wed, 8 Nov 2017 15:00:36 -0800 Received: from [172.19.2.220] (helo=xsjalistai50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1eCZKl-0002Cg-Ok; Wed, 08 Nov 2017 15:00:35 -0800 From: Alistair Francis To: Date: Wed, 8 Nov 2017 14:56:37 -0800 Message-ID: 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.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)(376002)(346002)(2980300002)(438002)(189002)(199003)(118296001)(9786002)(76176999)(50986999)(4326008)(77096006)(36756003)(33646002)(356003)(8676002)(50226002)(2906002)(47776003)(478600001)(305945005)(36386004)(316002)(16586007)(54906003)(53946003)(575784001)(50466002)(48376002)(2950100002)(189998001)(6916009)(106466001)(39060400002)(2351001)(81166006)(81156014)(8936002)(5003940100001)(5660300001)(106002)(63266004)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB3391; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT021; 1:LXYvKCU2F4YVisBrlBjQUfa5t21kxPKiLukDR8ry89C/3BirsD8TveDrnPTxs3/F2XobQXeZ4MutKBYW94oFjy+Ou/eibf9cNEN4RSotFu5x+Xmku+wds7+1QFt3XodN MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1c8ff85f-5f1e-4d61-fb5d-08d526fc88f6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603249); SRVR:MWHPR02MB3391; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3391; 3:S2sPb2kjKPI0nr2ockkKQewsI20zjjstXaG3X/AyutXodUFJw4Bic8ul2SY9VdySiiGSm4ySq0s7QqWdlqrJvOZrYxVXhQXTkWx0OdRE44D/hr2mEg+LeFaGku6Cc5e4hq22ICr0yo9V1bqvhskCohU/lPB0HSsU1xWelws132mug38IWQ9EVxFj7zxkM75GAjgb5wRWsy3CHgXkNrEGNju1KSSAOCY+bCQr7Cqx0kKJnUbIu2gB6mXuWyjMHbewlKDQndB9pk6Fktr1xWcERAHamEDxtrfegz03YGugQXUVLGqRidutMqvxvtbm9bdggM4LyLqvPmBUXWGZNYVk6G8h5MLaBCQepocAS+k8AfY=; 25:VbcQaMqTjQcF2N7RVUU7hsO0F9NwgYRFNKAAGVeImKiVO2HxoIdeguxQ2rqDC52Sw7OjeJhJimUr0YLhTBH8md1H9S9gWPk5FGTUfBnStsoKm35wu54Y/Wvh6rEblz9UHRWq9ijq+t36R2nYKhhr5XgEh861zVY3y3iq+ayZeq/ojXlkzmD4vF+v8F8hgJriY8Qv2ZrrmoSk5bze5K4cEieZQ4WRs2K2OFeTMv0D8hvlxX2pKaKZTyX6o5ox3mGOPeabC23sNreXjhmZ3z39Z34WFZXFDhHuBzXoPfaplm0SjLZ+MxNlG280Qe6L/E7NjxGXvHNAcVVofAJF7cIE/g== X-MS-TrafficTypeDiagnostic: MWHPR02MB3391: X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3391; 31:J05Jqcqt9NZ1REnVHMmhjOLlOUEITl2TRlOBqSrUzPTo1GV9VoJ+AZj94mP0aHMxpt7Id7j0hbWeRDsWNhJhSt2e/sEdiMpJezlYghhfbtOeNlw1fUSv1qRg2rrVP5jxNWjTPRY/YAgGd/da/nAS0w02vLarmSvdwGP8Dzbl/K9w5XlgP4wUFrghWcZ5BTzLgjY+1+rj+0TvZrjNFHiZN2co1UGyGyINCeD/5E5ZRt8=; 20:OIKSuZppsvM0ttv+5LaVcTIzeZMzG2Se8hcV7U8SnYS1aj9TSXb83cwysGzyYSHCs+C9hVsycCz9HRef45/wsFvKHR4eWzEBF0zWPw7r8OiL4QCKR/blndQaHiBy1CLO3Pdj6Bf4Bo5QxcyocmEiJXzpNv32/P55O34inXqor2Gwqu97/CWjlJFbvYMh2JPZNzZ07OyzVxViYQTgBfMqXqHKV/qBdlq4+jH0qDGDVIvFmSq8xbn+VzFgHX/or4H4o+xDgGFfjsRHQrzP0WTVlXTfYnlW8109y2St4TWxL9gqt8h6eVImIUBIV+N+X6N+RCq4zPaJ2prx3b/nbEQxhn4UHQlwBZuW5nalpSny7Ol4f0lIOGszl8hV8dc9APR62ojdRjG6yg9X3EhZMnqh2JHXNnGE3TpdupWqsrcGSYOQpqwvlETIM1zU910t6JOfy5VcR8WEHTefPoUF2omQnS6BvVIYXrf4mET7utefr3my+Zu6yILt9JyXJIydYauA 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)(5005006)(8121501046)(3231021)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR02MB3391; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR02MB3391; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3391; 4:yJrSf92u2ZwNt0L8ai4dfxHJNYAiDT3qdxVn35h2tNGCYU2Rsd3LR/MkzslB58NIAuN/v3N2QM8ZCwfQnDwUPHEyv8ToBm1SpByi7tCd6JDtyAenkC/oBMVRaI/gkSehgGWZq+BqJyYbbfQpBESEN523XC2PHiTs17E1GxCmgAnW+AI2l0VILhnw4uNmx4yMOUr0k9ycFw3lGbEYhmehNgQ2TOG0PrC5tIVD/x4KlFCPLAoq+QnQe7ru1dIvrdNvvR2z1oOzMez2yxR0jG0MjXbSFTHK1wx3pFOfhNOLNR6F3zDh6/cKX6IhAIyIysxGMratBerQyGx+7535gRNTAw== X-Forefront-PRVS: 0485417665 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR02MB3391; 23:yxrVwqVBBCc1hk4ceBj9w7xuKlon+2Xg2bjgQM+QU?= E2FbZEp3ERkcoAjz7Jye5aHOoT4IFz09gKToIsK7z032yYyuUS+8Og6H6t/Ybjb5p56JfWd7lpwMPaA9hp3VHZluG3aNz+1O/ow7bWw5stXgsPap85naZsi87AwCytfg3KqdAndZsIyaJK2ze2A+LoERa2CRXk29PZ09UiNDcyU3umuU2Typqrfx2Kx4TpWQfpMkgyyC2clCzLvwYrDC6kkTrLac8pVchfdASaQfCp7t++kUfn0DMsZnF6IBCsMUTOUQhz7iADf47jMzEbCRkZovAUNqjHEa+we5bUv5EhvmYs4j3bfNhjh/CG0oEgCWlqKP082gG62paxODYZ8O+S5kTHmTCNFe/2DsRigWic/C2SIiatgkEbFoE0LbX8AHZYRh8l+3AdQg2zkdy+Wu6iN6zyIviTUIuAT1c1styWFb4yrAtip809J4fdb2mbt0y2pTn/cN8BzgCJp8LhpiB/hDOG/sMqCNoAdn3lvv/vBpuQ6zZYkjTabcUHrsBccwMaw+eu0gzpnifgNdpnFZJu3eOjMmEILe9h7G2sCyZE6Do7975cO5tnoQWN4Kego7WRaPD/m3d3Ifz0ztj5tktzFP9VsqdQHlTW0xvICm84w9jX6o7F59jv8J/k5+uP+vypaXeUMlKuq+oMlX8vvH0tmaDo4zUeoMqI0JnsVApLAa/pthvzHmv7WBYqssW94+7TLCOV0sOZJWmdSdx7kOpoewlPqRSPHKnnKSfbpZJG9CPQMXMN4qdoGIZATsiYTtQLCi+xdvWbgh4PhzwwTI73wUM5DL586E0P7ddwT+q0vWiD71NkRd2SCQu5JCPPz1v+LKKbwozYRKXUQUaUuPLdyfRkU79/Wuvwru7CUXfmfvG8JiRCL2wXGL0sTwdTnOg6T/OLgnC/2VEcmvEyBlniPz5IXd3lReg+8URI7LRhRvXOGOzmWX7qrkHUGz5iWbWfmJuig0qYbB1wc0KcxgfNLy86GhAFdHFutqdrY68p0xU45chCp/nhuJRq/f7NOIebZ9vv4SArDBLFUkZgv8MZR X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3391; 6:sfgs93JXt00dYatHWW2DjPRt68kEEeUllMkzlOMssCHwM11BKcx0m1W3zFKm6TgR7QVIDXSglaSa/Lu8Vis1welMT4PnSB1kvWudN7BbZrDogOHjcV37XgGATxYYwzj2N09HMHuKhujfbbwVThCKRtAfo3I6N7BDyOak5s7egHA99ATT0NcZzjMx0k7d7JpBEMQ5DNj2s4rTcMEN+yQmg6VlRaVo3VoqW8EKdDv1gTGsXhlHvurvfO31oJ0+V8AeEt/W9hPSS9uWBRgEuDZ4VkkA3tLQ4rEZOH9iydGurTY9I+lR2mTKnTASZbw2DJpWamhXLrCMMAXSvhRhWkU89KlWkmR2855Up2xvVXtLTPU=; 5:qXcqGauM+PEurqEedlmjxW0HRiSXhmsRrKvaFIKc0ZtKsgxc2ZigbrUVjtuMS1zxco0qV6PIr0XxyD+aplxSkew53eACAC2TcYvkoDQtR4WsjmTV7CZVvHdxq0fz/YsEttsfYdqzNFzBM7DJRlzfKss0hN9sMDHSJMZj+ksCqMc=; 24:107shkrxlZ5bGAV1FpxDnnH/5sSbPo2lISqpQuIQnIEgj7IbbDpYEXTiAUpAMCrSoMPAvlN6NN6t7rVKyBB507ATa+y7ptk/o00ARxCa21c=; 7:eSqest7kGzJFUEevVm+hjamWrCaJwk6k8CCQFMnt9YtDsF1wesbahN7tAhxZw5oKveVnrcmV8wxIWmRwvRytfENxnO+8zEN64XB9U6GmSM8cqlj6lmOjtr8ELUXNyU5PdMeRLxtqnJR+QZzI44rJoWjTyoQQoMogymx8wMvGmEey5OGgNGan5bkv8NJ9PcFebcboH7/S4tH7O8K8rifaSePbOcytvw0XxbTEkPkW97VpV3CLe3v3SMLZYuH9/4KE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2017 23:00:40.8357 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c8ff85f-5f1e-4d61-fb5d-08d526fc88f6 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: MWHPR02MB3391 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.74 Subject: [Qemu-devel] [PATCH v4 04/45] 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+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 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-test.c | 8 ++++---- tests/migration/stress.c | 36 +++++++++++++++++----------------- 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 434a2ce868..5fcd63eda5 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -621,7 +621,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) tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y) @@ -788,7 +788,7 @@ tests/migration-test$(EXESUF): tests/migration-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_scm_helper.o +tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_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-block-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 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include #include "libqtest.h" @@ -1859,7 +1860,7 @@ int main(int argc, char **argv) ahci_pedantic = 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 @@ */ #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 = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine, (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 = 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 = 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 @@ */ #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 = -1; fd = g_file_open_tmp("blob_XXXXXX", &pathname, &error); if (fd == -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) == -1) { - fprintf(stderr, "ftruncate(\"%s\", %zu): %s\n", pathname, + error_report("ftruncate(\"%s\", %zu): %s", pathname, BLOB_SIZE, strerror(errno)); } else { void *buf; buf = mmap(NULL, BLOB_SIZE, PROT_WRITE, MAP_SHARED, fd, 0); if (buf == 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 @@ */ #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, uint64_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_size " - "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 #include "libqtest.h" @@ -155,7 +156,7 @@ void migrate(QOSState *from, QOSState *to, const char *uri) continue; } - fprintf(stderr, "Migration did not complete, status: %s\n", st); + error_report("Migration did not complete, status: %s", st); g_assert_not_reached(); } @@ -199,7 +200,7 @@ void mkimg(const char *file, const char *fmt, unsigned size_mb) fmt, file, size_mb); ret = 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); 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 @@ */ #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) node = 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 addr) node = 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) == mask) { if ((node->addr != allocator->start) || (node->size != 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 0ec8af2923..b0fca61f79 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" #include @@ -89,7 +90,7 @@ static int socket_accept(int sock) ret = accept(sock, (struct sockaddr *)&addr, &addrlen); } while (ret == -1 && errno == EINTR); if (ret == -1) { - fprintf(stderr, "%s failed: %s\n", __func__, strerror(errno)); + error_report("%s failed: %s", __func__, strerror(errno)); } close(sock); @@ -155,7 +156,7 @@ static const char *qtest_qemu_binary(void) qemu_bin = 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); } @@ -334,7 +335,7 @@ static GString *qtest_recv_line(QTestState *s) } if (len == -1 || len == 0) { - fprintf(stderr, "Broken pipe\n"); + error_report("Broken pipe"); exit(1); } @@ -419,7 +420,7 @@ static void qmp_response(JSONMessageParser *parser, GQueue *tokens) obj = json_parser_parse(tokens, NULL); if (!obj) { - fprintf(stderr, "QMP JSON response parsing failed\n"); + error_report("QMP JSON response parsing failed"); exit(1); } @@ -445,7 +446,7 @@ QDict *qmp_fd_receive(int fd) } if (len == -1 || len == 0) { - fprintf(stderr, "Broken pipe\n"); + error_report("Broken pipe"); exit(1); } @@ -902,7 +903,7 @@ void qtest_bufread(QTestState *s, uint64_t addr, void *data, size_t size) g_base64_decode_inplace(args[1], &len); if (size != 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 = MIN(len, size); } diff --git a/tests/migration-test.c b/tests/migration-test.c index be598d3257..2918a322fb 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -11,7 +11,7 @@ */ #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; default: - fprintf(stderr, "Unexpected %d on %s serial\n", readvalue, side); + error_report("Unexpected %d on %s serial", readvalue, side); g_assert_not_reached(); } } while (true); @@ -334,9 +334,9 @@ static void check_guests_ram(QTestState *who) */ hit_edge = true; } else { - fprintf(stderr, "Memory content inconsistency at %x" + error_report("Memory content inconsistency at %x" " first_byte = %x last_byte = %x current = %x" - " hit_edge = %x\n", + " hit_edge = %x", address, first_byte, last_byte, b, hit_edge); bad = true; } 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() == 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() == 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; if (fp == 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; } 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 += strlen(name); if (*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/cmdline", + argv0, gettid(), name); } start++; @@ -106,8 +106,8 @@ static int get_command_arg_str(const char *name, end = strstr(start, "\n"); if (end == 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/cmdline", + argv0, gettid(), name); return -1; } @@ -132,7 +132,7 @@ static int get_command_arg_ull(const char *name, errno = 0; *val = 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) fd = 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; } if (read(fd, buf, len) != 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; 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 ncpus) static int mount_misc(const char *fstype, const char *dir) { if (mkdir(dir, 0755) < 0 && errno != 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; } 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 = 0; ramsizeGB = strtoll(optarg, &end, 10); if (errno != 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 = 0; ncpus = strtoll(optarg, &end, 10); if (errno != 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) case '?': case 'h': - fprintf(stderr, "%s: [--help][--ramsize GB][--cpus N]\n", argv0); + error_report("%s: [--help][--ramsize GB][--cpus N]", argv0); exit_failure(); } } diff --git a/tests/qemu-iotests/socket_scm_helper.c b/tests/qemu-iotests/socket_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 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include #include @@ -53,7 +54,7 @@ static int send_fd(int fd, int fd_to_send) } while (ret < 0 && errno == EINTR); if (ret < 0) { - fprintf(stderr, "Failed to send msg, reason: %s\n", strerror(errno)); + error_report("Failed to send msg, reason: %s", strerror(errno)); } return ret; @@ -69,14 +70,14 @@ static int get_fd_num(const char *fd_str, bool silent) sock = 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 = 0; i < argc; i++) { - fprintf(stderr, "Parameter %d: %s\n", i, argv[i]); + error_report("Parameter %d: %s", i, argv[i]); } #endif @@ -120,7 +121,7 @@ int main(int argc, char **argv, char **envp) is supposed to fork and exec this program. */ fd = 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 @@ */ #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 >= 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) 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); } 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 *fmt, ...) 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=%d\n", sig); + error_report("alarm signal=%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) } } - fprintf(stderr, "test-i386-fprem: tested %llu cases\n", count); + error_report("test-i386-fprem: tested %llu cases", count); } 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 = 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 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "libqtest.h" static int verbose; @@ -79,7 +80,7 @@ static void test_commands(void) for (i = 0; hmp_cmds[i] != NULL; i++) { if (verbose) { - fprintf(stderr, "\t%s\n", hmp_cmds[i]); + error_report("\t%s", hmp_cmds[i]); } response = hmp("%s", hmp_cmds[i]); g_free(response); @@ -102,7 +103,7 @@ static void test_info_commands(void) *endp = '\0'; /* Now run the info command */ if (verbose) { - fprintf(stderr, "\t%s\n", info); + error_report("\t%s", info); } resp = 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 @@ */ #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 >= 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, int nreaders) 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); } 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, uint32_t expect) uint16_t mask = ~(PORTSC_CSC | PORTSC_PEDC | PORTSC_OCC); #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) == (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 = elem->out_num; out_sg = 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) } if (elem->in_num < 1) { - fprintf(stderr, "virtio-net contains no in buffers\n"); + error_report("virtio-net contains no in buffers"); break; } @@ -364,7 +364,7 @@ vubr_receive_cb(int sock, void *ctx) VubrDev *vubr = (VubrDev *)ctx; if (!vu_dispatch(&vubr->vudev)) { - fprintf(stderr, "Error while dispatching\n"); + error_report("Error while dispatching"); } } @@ -461,7 +461,7 @@ vubr_panic(VuDev *dev, const char *msg) { VubrDev *vubr = container_of(dev, VubrDev, vudev); - fprintf(stderr, "PANIC: %s\n", msg); + error_report("PANIC: %s", msg); dispatcher_remove(&vubr->dispatcher, dev->sock); vubr->quit = 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 = gethostbyname(host); if (!he) { - fprintf(stderr, "gethostbyname() failed.\n"); + error_report("gethostbyname() failed."); exit(1); } saddr->sin_addr = *(struct in_addr *)he->h_addr; @@ -590,13 +590,13 @@ vubr_backend_udp_setup(VubrDev *dev, lport = strtol(local_port, (char **)&r, 0); if (r == local_port) { - fprintf(stderr, "lport parsing failed.\n"); + error_report("lport parsing failed."); exit(1); } rport = strtol(remote_port, (char **)&r, 0); if (r == remote_port) { - fprintf(stderr, "rport parsing failed.\n"); + error_report("rport parsing failed."); exit(1); } @@ -714,15 +714,15 @@ main(int argc, char *argv[]) return 0; out: - fprintf(stderr, "Usage: %s ", argv[0]); - fprintf(stderr, "[-c] [-u ud_socket_path] [-l lhost:lport] [-r rhost:rport]\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:rport]"); + 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"); return 1; }