From nobody Tue Feb 10 02:01:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@gnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506733024349463.5518272105686; Fri, 29 Sep 2017 17:57:04 -0700 (PDT) Received: from localhost ([::1]:37667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dy65B-0000FN-Hi for importer@patchew.org; Fri, 29 Sep 2017 20:56:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dy5X2-0005ZO-2o for qemu-devel@nongnu.org; Fri, 29 Sep 2017 20:21:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dy5Wy-0006qu-SO for qemu-devel@nongnu.org; Fri, 29 Sep 2017 20:21:24 -0400 Received: from mail-co1nam03on0042.outbound.protection.outlook.com ([104.47.40.42]:23546 helo=NAM03-CO1-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 1dy5Ws-0006lU-3J; Fri, 29 Sep 2017 20:21:14 -0400 Received: from MWHPR0201CA0008.namprd02.prod.outlook.com (10.167.160.149) by BLUPR0201MB1923.namprd02.prod.outlook.com (10.162.239.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sat, 30 Sep 2017 00:21:11 +0000 Received: from CY1NAM02FT011.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::200) by MWHPR0201CA0008.outlook.office365.com (2603:10b6:301:74::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Sat, 30 Sep 2017 00:21:10 +0000 Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT011.mail.protection.outlook.com (10.152.75.156) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.56.11 via Frontend Transport; Sat, 30 Sep 2017 00:21:09 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:43475 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1dy5Wn-0000G7-6L; Fri, 29 Sep 2017 17:21:09 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1dy5Wn-0007bK-2r; Fri, 29 Sep 2017 17:21:09 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v8U0L2i6001149; Fri, 29 Sep 2017 17:21:02 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1dy5Wg-0007Zt-8H; Fri, 29 Sep 2017 17:21:02 -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=7druHVznjh8NnI7iR3QneP1t9nhCqhU04FiW8CfQJgQ=; b=i3qXBkBQ2q15rSlwwlF8YnbtiroznZ44vDuANFXl1yoQ+PAkxH68YKE1GAvBDAyHaadwySiFpFQMVeBwoNnNKqf0w0AysQAKcJupounlI9aROyqzViDLBuW9XxmT39oSzvLtBPqAoPRE0KqCowRCsishGwNF9Is5gOpc5ykb3fc= Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@gnu.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: Fri, 29 Sep 2017 17:17:15 -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-23358.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)(376002)(39860400002)(2980300002)(438002)(189002)(199003)(77096006)(2351001)(2906002)(36386004)(54906003)(305945005)(6916009)(47776003)(39060400002)(5660300001)(106002)(16586007)(9786002)(4326008)(36756003)(81166006)(81156014)(478600001)(8676002)(356003)(50986999)(189998001)(316002)(5003940100001)(50466002)(50226002)(48376002)(8936002)(63266004)(106466001)(575784001)(76176999)(6666003)(2950100002)(118296001)(33646002)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0201MB1923; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT011; 1:b+Ryq8c6fpA37QZiZiKs/AV7U9/tBwAd+v2mQGC/zth8aP16N91xwrGllv/rqEXmICMODO8DI64zK+APfCfMvBq+QqZGnqdLfST935rsK8Y1N8g7c+J7MC/fgEpMRoce MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bd716b62-a85b-43e3-bed6-08d5079926b2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BLUPR0201MB1923; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0201MB1923; 3:U5hujEJGuYk+2oirhhmg8pNM8E/aw6glKTNQIC/WLhlO9dIvB3WLVKqzPJLpCQmdNKQLbn+znyLPoUTmHI6OcWB4jn80OJsSZcCGMV/78ddwx9ZYMF8XZVFxusgla4Y2mlRRkrzPJumFCIcxzyu17/pr66JaxXjvUBGU7rqrZHW3e6HfnaH0XV1GOJ4lZm/DeDdlKCvHDLyyaKJPshxhqf2ytE9ZboO3sfhz45o2Zyg9KD+nNDmyRBI/nt2FRd8ucc1tHxSjrnLxkF6h6gSnBt/Gz5+nVUPaM1L1zE7KYWPuNjfnrnN6H9N+wJh0VRXO+2Sj8j4ECj+m4uESeBSbKC1Ou8nPgKaZ255yj3fDDl4=; 25:qwgK4NvDdrnJeO+7T89LmGI+B/SXel83D+C/7+oevPtVPQ65F+VnbZ+538RGD42cieqzv70b6rxyvA9NXiLH0jQH57/NUI67OeSighCx8AcRBccy97jSIwZZ+awTivgyyaN1acRbAfyvjKqsZpTsJzGM1jNS1xml+iXUUOYj9Zv0xbBhu2avoTUZ+Jkecj+QIxLdwl79AFtFoOoH/WTpMsJjcAHi9pZl7poViFYz6PPst0SGZXYxVqAvLKutivk2rvuKdwkuc2SgK1J0UX+OWkZiQY76uLljPBZYMApv2EAPFY1w5e+cxGvQPFu2r8i4qA1ISgWGtl9eM/bekjJSjA== X-MS-TrafficTypeDiagnostic: BLUPR0201MB1923: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0201MB1923; 31:7r7y/BHU0eRJmpoAwgFoRTZ1GxjelvGYuC1a2fFlLekKdEro2AdI4M65pZp9LKBwDA5vYOjYasJsKoPKEChjVhyDnXlgQn7sFSkpWLEd1A2hmBKqprHoINT5YcUNEtfLi6eW+at+bID+Vyal07Rmwxs+C/3Xe3hwccCfhGeb0IObt36Ugy+Zmp6irS7lpZJVi8Joas5dD1s1TIzJQCdzLrAgVEbUh3JU+qANAazKxUU=; 20:eVSTEg2/p4pBCZAbEnhzw68JTVfbWs+VC8cRfAbqtn0Wy8qeROnT67+wOpADR3QQVOpLOfrrXlw8mPiv+wqgej0orysV5F2ebpNMtubbfGnGCEpnhBEKEVbP32Tb1OG49NWz5e7VljykxM39Np1f2jUvknU6EiNi3irEJ3Px0PShBbHw/AvP2LxfrdZ+v/M/33q9JDGCS2zfPlmiQEmapzIQpe/1XIIRrLDEjyMoaqHii4p9XFZaA5JKVtB5iyenUATInNERb+fqktYSlgVe+JGt9BvRLFB/jyh2lyEnkIkiSEAYGpTeXoa9ruanZNUo/CPtbyVo0RvnnHQw3Tox/QKifRQ51FoUm2lKXO6FU5UPAipopJ2p0nSchTgPD8ejJ/9836MAp07Lr9CPNNbzoajARpoGO9Pcgg9gZZjdNrSVuQADYb3WpDzreIQ7M/GkxYjZM07ghDz+hxCzI4mIwq5ikmopcaxGu7IQfyoibsK/ySk0jkpSPPnmy97yuQhV 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)(10201501046)(3002001)(93006095)(93004095)(100000703101)(100105400095)(6055026)(6041248)(20161123560025)(20161123562025)(20161123558100)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0201MB1923; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0201MB1923; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0201MB1923; 4:RPA1e8Pcev+xKmkoVoFIhJHZLA5qtjmFDjlGGBv1RhFp158dp3c7QTvkAal2y9SKXrDcuOYfXbDCi7FdXG2ZHBgXHytnZxO6rl7XDIe5BRDK8H0z8b5Vhgb7+RGwsKVCjygKSd7SguUiBXOWtKvkfiqUGT5zT2yVBaiCeCXXXNfKUlGngYwY8+lhAFhduwOb8JgATVvUrfivLsJLjX8pBbnydmkY/kkpnjmNRs+EC5FsiCvkcq+D7j1fL4dhCGoEODaiETn0K2qGr/7bRmpcDdRRdBtQ7T8u8lYn3A+cDwLHIpzUR4PKeYSayq1HB/JHxSePFr95zSGNHUa5yOVNEA== X-Forefront-PRVS: 0446F0FCE1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0201MB1923; 23:VYG4+BmndQYmEToAG6YlwY3sCZ1Ip+t1mNzNYYB?= =?us-ascii?Q?Ve9aHdWfdDosT/Xz77VdSx3UbIzLUCGm2ExlWvcerhLeGIHFY7XDL4WTfq1Z?= =?us-ascii?Q?roZJP6UE/0DQTALUZH7BWb0dsAuXA/DJQvzU/umBvdRg0RmrPzGRaNGtnlAD?= =?us-ascii?Q?8L0B7i09NHO/85EBXz3X0f8HkDgRzc3DIKAozb0p4hnLJDRxgGz0dhIGyjir?= =?us-ascii?Q?/2H0wkIizIkktpk8pAiNNLiMO7IunZvimLT/EzJw0J4k3nA8pr5Pz792GYQL?= =?us-ascii?Q?j4Js+td14VBGnm3vTL0joWasU8egaKi6z0nJpjl5avD6ExF/idEvzbFKLttt?= =?us-ascii?Q?lwjJb8E4afw5gObQmUxCVV6uNclpfHHbr3CFKnVcT4XDHNyM56M0sj7zDJTk?= =?us-ascii?Q?qqb0DXpjnSuouXpIL6C2mMi0rbf9WQEnV9A7bfPx6ohQRkzP85q7h5AgmQgh?= =?us-ascii?Q?0ZgWlNohw40CkrA8YekyfsCujcmOKIWoadyLD2QtvVF8SiPKjF5fwMTgYq+A?= =?us-ascii?Q?Z+WHKR103CecYvHzT2ThkU0CkfGp20wsGPwauLx0Rd6byqEeByusCipVaeKl?= =?us-ascii?Q?9/0VMrJXj1KbmfP1DclAwj+qjvvYq0w4MiYrvzl1jJxzpROaqE6YQLaYhC0y?= =?us-ascii?Q?IJB8p8MmvPwTD0GNYkNhtS0JJwOVXNLIYpgvbxsV+eUN7nxVBjx27vsqA2cR?= =?us-ascii?Q?ot4lDivBiN/9Fx/kRzgTdewvDxvOEl8pT0ABXGYfd+LUoEpvXvIsVyDEWNRN?= =?us-ascii?Q?OQyVzI72n0tTJmHVJ+K+8dM0BCJlyqjADwtIjSsA2vA7dLsBq3cfPQyXm+HN?= =?us-ascii?Q?ErPMq9p3+cl+YAzxDgbfwxQ2Qv2H9tsMR/stMj1bbYdEjP1X0pYxrHLRmvPs?= =?us-ascii?Q?AXyWpGkEgij9JSdyd0R6Y7mE74z3ynmR70tnM5WIHHes5OJ7eTVAV8SoLI3C?= =?us-ascii?Q?VYE1ETds4w6RXJAspLTHUIGh2/gOP+OGtpfueNn3l4o1VP0NCleRbFXQFMJH?= =?us-ascii?Q?EEATxVWKpPHwVkmpb9JtbAZIw+SCHtaFDTnUha7MxtLtxSMwr2R6oNGlWZ07?= =?us-ascii?Q?CsMGHARHyiUtRRpORpFaoP2eBd0u7CPd7os/64QcrdR+fRAd4Zw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0201MB1923; 6:89PpVE1/P/HRL9PgKIYe7TsHfqAO+j/6J6giR4e1TvXA5fBxWyL7++nierQvwLWt2+uATyVTewONF7lUd8EEDFOXSMSx7Y8pIA8guSUYGJsOMa+T82FRCIMg9Hn+glq9SRr3Pvsr6hT8sD4zvy2j3gnC/q05qv0fiEBbNsN3gjyvX8hmUDymSgSzpnM86h0gUeu8czcK12KCdd6UKezCcjlaIIybh6HhLdTCHE4qZu5C0NvBwmw1Qx6iWi+jMF3I2fNO3AhyuPWxF0xDlH0SeuvZLCMM9ZypPLpUYyunuZjCAcamW8nrKmsRTQG6OKRJkNZkhGNS+MYnJbmSbBIzyg==; 5:TmcXNtlmlVo9WMk6BRyxrL81oLWKn1FDBGOweRSkN0qW+4nDJ6tBOOAP6zJOaWjf+iyCkxX1IPL6mzZka/ap1BsGBfIVS5egO6ogJs7xKYLkltZrwpJn+Q0dSd2gWWaQaHDDKPA91nipXUSs/SKgQNKiJKhk8pN0FHzKQuie+qs=; 24:27z6wexRYIagUDcL1c5g2LedIDzzUIgOGs9zCJ4ZnvE7yjCd9Dqg0hItp7OPYEoYIZO8zZN6fF9vm3jMsoDlXiKNrlO5KCK+JD4P5QLO7sk=; 7:GEQc5mlcWPxPfCLhd63QShPjpHVIr7CQE+7k0N+9bQgjT5GSBsSjlNxxiytUb453AS+wW9EcsckaqReLVurkNjD9jmMqFFaFYVjomzjlSdIyC/HgQyx47lbebUB2/vZhKVNbP0FhbZILuUPbgmdM06MbpQWKX/ZjSQICj8GRYK2ikbnRnlU7mKUaU037oHENL8iJ5TdxVOKgh8JZ7gUtjQY54836U3LN2YPYx3JwzB4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2017 00:21:09.8119 (UTC) 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: BLUPR0201MB1923 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.40.42 Subject: [Qemu-devel] [PATCH v2 43/47] util: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Stefan Weil , armbru@redhat.com, alistair.francis@xilinx.com, Paolo Bonzini , alistair23@gmail.com Errors-To: qemu-devel-bounces+importer=patchew.org@gnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 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}' \ {} + Signed-off-by: Alistair Francis Cc: Kevin Wolf Cc: Markus Armbruster Cc: Paolo Bonzini Cc: Stefan Weil Cc: qemu-block@nongnu.org Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- util/aio-posix.c | 5 +++-- util/coroutine-sigaltstack.c | 2 +- util/error.c | 2 +- util/main-loop.c | 2 +- util/mmap-alloc.c | 3 ++- util/module.c | 6 +++--- util/osdep.c | 4 ++-- util/oslib-posix.c | 3 ++- util/oslib-win32.c | 3 ++- util/qemu-coroutine.c | 5 +++-- util/qemu-progress.c | 3 ++- util/qemu-thread-posix.c | 5 +++-- util/qemu-thread-win32.c | 5 +++-- util/qemu-timer-common.c | 3 ++- util/qht.c | 2 +- 15 files changed, 31 insertions(+), 22 deletions(-) diff --git a/util/aio-posix.c b/util/aio-posix.c index 2d51239ec6..fe4772b4a9 100644 --- a/util/aio-posix.c +++ b/util/aio-posix.c @@ -15,6 +15,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/error-report.h" #include "block/block.h" #include "qemu/rcu_queue.h" #include "qemu/sockets.h" @@ -696,8 +697,8 @@ void aio_context_setup(AioContext *ctx) { /* TODO remove this in final patch submission */ if (getenv("QEMU_AIO_POLL_MAX_NS")) { - fprintf(stderr, "The QEMU_AIO_POLL_MAX_NS environment variable has= " - "been replaced with -object iothread,poll-max-ns=3DNUM\n"); + error_report("The QEMU_AIO_POLL_MAX_NS environment variable has " + "been replaced with -object iothread,poll-max-ns=3DNUM"); exit(1); } =20 diff --git a/util/coroutine-sigaltstack.c b/util/coroutine-sigaltstack.c index f6fc49a0e5..96a01c2c88 100644 --- a/util/coroutine-sigaltstack.c +++ b/util/coroutine-sigaltstack.c @@ -80,7 +80,7 @@ static void __attribute__((constructor)) coroutine_init(v= oid) =20 ret =3D pthread_key_create(&thread_state_key, qemu_coroutine_thread_cl= eanup); if (ret !=3D 0) { - fprintf(stderr, "unable to create leader key: %s\n", strerror(errn= o)); + error_report("unable to create leader key: %s", strerror(errno)); abort(); } } diff --git a/util/error.c b/util/error.c index 3efdd69162..e423368ca0 100644 --- a/util/error.c +++ b/util/error.c @@ -32,7 +32,7 @@ Error *error_fatal; static void error_handle_fatal(Error **errp, Error *err) { if (errp =3D=3D &error_abort) { - fprintf(stderr, "Unexpected error in %s() at %s:%d:\n", + error_report("Unexpected error in %s() at %s:%d:", err->func, err->src, err->line); error_report_err(err); abort(); diff --git a/util/main-loop.c b/util/main-loop.c index 7558eb5f53..d8369716b2 100644 --- a/util/main-loop.c +++ b/util/main-loop.c @@ -95,7 +95,7 @@ static int qemu_signal_init(void) sigdelset(&set, SIG_IPI); sigfd =3D qemu_signalfd(&set); if (sigfd =3D=3D -1) { - fprintf(stderr, "failed to create signalfd\n"); + error_report("failed to create signalfd"); return -errno; } =20 diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c index 3ec029a9ea..11887aac69 100644 --- a/util/mmap-alloc.c +++ b/util/mmap-alloc.c @@ -11,6 +11,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/mmap-alloc.h" #include "qemu/host-utils.h" =20 @@ -51,7 +52,7 @@ size_t qemu_mempath_getpagesize(const char *mem_path) } while (ret !=3D 0 && errno =3D=3D EINTR); =20 if (ret !=3D 0) { - fprintf(stderr, "Couldn't statfs() memory path: %s\n", + error_report("Couldn't statfs() memory path: %s", strerror(errno)); exit(1); } diff --git a/util/module.c b/util/module.c index c90973721f..1153e3ebb0 100644 --- a/util/module.c +++ b/util/module.c @@ -124,13 +124,13 @@ static int module_load_file(const char *fname) =20 g_module =3D g_module_open(fname, G_MODULE_BIND_LAZY | G_MODULE_BIND_L= OCAL); if (!g_module) { - fprintf(stderr, "Failed to open module: %s\n", + error_report("Failed to open module: %s", g_module_error()); ret =3D -EINVAL; goto out; } if (!g_module_symbol(g_module, DSO_STAMP_FUN_STR, (gpointer *)&sym)) { - fprintf(stderr, "Failed to initialize module: %s\n", + error_report("Failed to initialize module: %s", fname); /* Print some info if this is a QEMU module (but from different bu= ild), * this will make debugging user problems easier. */ @@ -169,7 +169,7 @@ void module_load_one(const char *prefix, const char *li= b_name) static GHashTable *loaded_modules; =20 if (!g_module_supported()) { - fprintf(stderr, "Module is not supported by system.\n"); + error_report("Module is not supported by system."); return; } =20 diff --git a/util/osdep.c b/util/osdep.c index a479fedc4a..62d92c9560 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -425,7 +425,7 @@ void fips_set_state(bool requested) #endif /* __linux__ */ =20 #ifdef _FIPS_DEBUG - fprintf(stderr, "FIPS mode %s (requested %s)\n", + error_report("FIPS mode %s (requested %s)", (fips_enabled ? "enabled" : "disabled"), (requested ? "enabled" : "disabled")); #endif @@ -452,7 +452,7 @@ int socket_init(void) ret =3D WSAStartup(MAKEWORD(2, 2), &Data); if (ret !=3D 0) { err =3D WSAGetLastError(); - fprintf(stderr, "WSAStartup: %d\n", err); + error_report("WSAStartup: %d", err); return -1; } atexit(socket_cleanup); diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 80086c549f..d840692dd7 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -34,6 +34,7 @@ #include "sysemu/sysemu.h" #include "trace.h" #include "qapi/error.h" +#include "qemu/error-report.h" #include "qemu/sockets.h" #include #include @@ -87,7 +88,7 @@ int qemu_daemon(int nochdir, int noclose) void *qemu_oom_check(void *ptr) { if (ptr =3D=3D NULL) { - fprintf(stderr, "Failed to allocate memory: %s\n", strerror(errno)= ); + error_report("Failed to allocate memory: %s", strerror(errno)); abort(); } return ptr; diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 69a6286d50..2197a6a4fc 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -30,6 +30,7 @@ * see the license comment there. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include #include "qapi/error.h" #include "sysemu/sysemu.h" @@ -44,7 +45,7 @@ void *qemu_oom_check(void *ptr) { if (ptr =3D=3D NULL) { - fprintf(stderr, "Failed to allocate memory: %lu\n", GetLastError()= ); + error_report("Failed to allocate memory: %lu", GetLastError()); abort(); } return ptr; diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c index d6095c1d5a..1f7cce6706 100644 --- a/util/qemu-coroutine.c +++ b/util/qemu-coroutine.c @@ -13,6 +13,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "trace.h" #include "qemu-common.h" #include "qemu/thread.h" @@ -110,7 +111,7 @@ void qemu_aio_coroutine_enter(AioContext *ctx, Coroutin= e *co) trace_qemu_aio_coroutine_enter(ctx, self, co, co->entry_arg); =20 if (co->caller) { - fprintf(stderr, "Co-routine re-entered recursively\n"); + error_report("Co-routine re-entered recursively"); abort(); } =20 @@ -164,7 +165,7 @@ void coroutine_fn qemu_coroutine_yield(void) trace_qemu_coroutine_yield(self, to); =20 if (!to) { - fprintf(stderr, "Co-routine is yielding to no one\n"); + error_report("Co-routine is yielding to no one"); abort(); } =20 diff --git a/util/qemu-progress.c b/util/qemu-progress.c index 3c2223c1a2..84598f0fbb 100644 --- a/util/qemu-progress.c +++ b/util/qemu-progress.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" =20 struct progress_state { @@ -68,7 +69,7 @@ static void sigusr_print(int signal) static void progress_dummy_print(void) { if (print_pending) { - fprintf(stderr, " (%3.2f/100%%)\n", state.current); + error_report(" (%3.2f/100%%)", state.current); print_pending =3D 0; } } diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 7306475899..e7d1a68c73 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -11,6 +11,7 @@ * */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/thread.h" #include "qemu/atomic.h" #include "qemu/notify.h" @@ -25,14 +26,14 @@ void qemu_thread_naming(bool enable) #ifndef CONFIG_THREAD_SETNAME_BYTHREAD /* This is a debugging option, not fatal */ if (enable) { - fprintf(stderr, "qemu: thread naming not supported on this host\n"= ); + error_report("qemu: thread naming not supported on this host"); } #endif } =20 static void error_exit(int err, const char *msg) { - fprintf(stderr, "qemu: %s: %s\n", msg, strerror(err)); + error_report("qemu: %s: %s", msg, strerror(err)); abort(); } =20 diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c index 94f3491a87..46b5dac159 100644 --- a/util/qemu-thread-win32.c +++ b/util/qemu-thread-win32.c @@ -16,6 +16,7 @@ #endif =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "qemu/thread.h" #include "qemu/notify.h" @@ -29,7 +30,7 @@ void qemu_thread_naming(bool enable) /* But note we don't actually name them on Windows yet */ name_threads =3D enable; =20 - fprintf(stderr, "qemu: thread naming not supported on this host\n"); + error_report("qemu: thread naming not supported on this host"); } =20 static void error_exit(int err, const char *msg) @@ -38,7 +39,7 @@ static void error_exit(int err, const char *msg) =20 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUF= FER, NULL, err, 0, (LPTSTR)&pstr, 2, NULL); - fprintf(stderr, "qemu: %s: %s\n", msg, pstr); + error_report("qemu: %s: %s", msg, pstr); LocalFree(pstr); abort(); } diff --git a/util/qemu-timer-common.c b/util/qemu-timer-common.c index 06d084d364..ab7b702c4f 100644 --- a/util/qemu-timer-common.c +++ b/util/qemu-timer-common.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/timer.h" =20 /***********************************************************/ @@ -37,7 +38,7 @@ static void __attribute__((constructor)) init_get_clock(v= oid) int ret; ret =3D QueryPerformanceFrequency(&freq); if (ret =3D=3D 0) { - fprintf(stderr, "Could not calibrate ticks\n"); + error_report("Could not calibrate ticks"); exit(1); } clock_freq =3D freq.QuadPart; diff --git a/util/qht.c b/util/qht.c index ff4d2e6974..bfab5c7e5e 100644 --- a/util/qht.c +++ b/util/qht.c @@ -154,7 +154,7 @@ static void qht_bucket_debug__locked(struct qht_bucket = *b) continue; } if (seen_empty) { - fprintf(stderr, "%s: b: %p, pos: %i, hash: 0x%x, p: %p\n", + error_report("%s: b: %p, pos: %i, hash: 0x%x, p: %p", __func__, b, i, b->hashes[i], b->pointers[i]); corrupt =3D true; } --=20 2.11.0