From nobody Fri Dec 19 21:50:28 2025 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@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1508432378664291.283377770005; Thu, 19 Oct 2017 09:59:38 -0700 (PDT) Received: from localhost ([::1]:50262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5EAA-0004Cu-OE for importer@patchew.org; Thu, 19 Oct 2017 12:59:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Daa-0006Eq-0T for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DaW-0002NZ-MC for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:32 -0400 Received: from mail-co1nam03on0069.outbound.protection.outlook.com ([104.47.40.69]:4064 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 1e5DaQ-0002EO-Hh; Thu, 19 Oct 2017 12:22:22 -0400 Received: from MWHPR0201CA0001.namprd02.prod.outlook.com (2603:10b6:301:74::14) by DM2PR02MB1339.namprd02.prod.outlook.com (2a01:111:e400:50c8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:22:17 +0000 Received: from CY1NAM02FT040.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::207) by MWHPR0201CA0001.outlook.office365.com (2603:10b6:301:74::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:22:17 +0000 Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT040.mail.protection.outlook.com (10.152.75.135) 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:22:16 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:39553 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaJ-0007ya-OR; Thu, 19 Oct 2017 09:22:15 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DaJ-0003J5-Is; Thu, 19 Oct 2017 09:22:15 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGMAc7018318; Thu, 19 Oct 2017 09:22:11 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaE-0003Hg-Mp; Thu, 19 Oct 2017 09:22:10 -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=Lx8M0hVHclMFrMPQGF2WG/DiYM2feWjDlIobIskpdio=; b=tOrlc6kuxP5pxmG1f3yR/2QA1OIK8+vv5wYfypCj+dxFUr5XCgFVHr2mn4bkVB0F0R5DkQQoCs+xsz+a/uxgCAdNX+aWSeu2z4f1dzPhgCAawrNEFP4i9Iu9xBgT+xrPFpxY59I5Bu4eClhiKgU6QDgTf7v/JR2tWP/ktQahTxA= 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: temperror (zoho.com: Error in retrieving data from DNS) 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:18:17 -0700 Message-ID: <7f741376b50552aa58c943b710fffa3c24f28b2f.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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)(189002)(199003)(4326008)(47776003)(8676002)(81156014)(8936002)(36386004)(81166006)(36756003)(63266004)(305945005)(76176999)(5820100001)(2351001)(50986999)(77096006)(356003)(316002)(54906003)(575784001)(33646002)(106466001)(189998001)(118296001)(50226002)(23676002)(39060400002)(2950100002)(9786002)(50466002)(6916009)(5660300001)(106002)(478600001)(2906002)(2870700001)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB1339; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT040; 1:ZIBL7laA4hx7C++EH3/CyMtW6X9kbFTw0LzlShcy72iauxwlKbmCIjI/nQXfbibjvyFw7u893usdQqJGEykoT2KEjp0HW6LgcfRVQsyLtQ+mGhKBKOOBxg6y7M5LjGSs X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89788bbd-f5c0-45a0-4133-08d5170d907b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254169)(8251501002)(4534017)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423092); SRVR:DM2PR02MB1339; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1339; 3:a/kgHRIoxyBp0xD8XC6Iol6h8+mW/g4a6hGjiUNc2vFmQzbMbGLeof/chQTLtV+v40TfM5rqqDqQyQhbr2lZx2bJR/mtmZc+rdGSI0i5rUlAN8AwA2Gl+XMEJTil1Kd3k3+Mo9qTw3BWPfhS5rdqc7XaBZIujD3LnVTs1Hi5o9NLHGK35SbHRqXEwRJUX/PdoFdJCqH/pG2d/lGQA+Wvld+e8nT4a2XEZraOfXuZGgW4nplH/jVo5RJhvTgn05sG/XjP9XBvYQDwkyeKrwTNL6sEw+e5GSexJ+EsurPF3HxBBH5PJYGCGXWi6vbVOD0mgtQn/wywS6SlG3kTMu4ZKqBHm3IzTDbkPN6BZh3//bo=; 25:kHu7/ckZ/9l4mvqF6Cah+lA0TOFpO+JJCHAKS1u9iAHvbN0HkvZTkMbHKJ3ek5Yb33pw1oK0qPt+WtOPfTmq69UijKpy90I0N/2LXlGcOKm1a0wcfPU0UKORLVY1MXOHZCNcrmjfXmjmR2kytk9L/RtE0gCv8XL4YkG7fzuWHwsCDm1Rw9h8gej6fvTchRaOJEXQtZk77NEvn7r5c3UAS45MveSyN5u7WPkvgH9fvVGjiIN8o0lt5mnKXCGcKns8Aa7R1u+cqi16Mmc+sNo2hwy3dG0fvVW21wVfu+fPrTANsP0xGd3FQVX2pdcNHl/Qp0D3KGoxJ0v5Y4HOuwpJhA== X-MS-TrafficTypeDiagnostic: DM2PR02MB1339: X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1339; 31:5YIb92hXZdIvey40VbKnROHQj09dYWp3a6wyR0YcQx+7xtqKJSA4k0V7+UK9aWD/+aC7lLFnBxQHIFKFSDseWtulmpsNt7kzmwFKJj2e7Mc+KS8LVWatlmywmRI5OttreHYVRvwpiO3NtGh2leUhKcbqoqlLve8k8ONyYgy+0Wk9/kJfvDqQQ9POorPRbTAPy7N3GINYrZkNx/jM5trsrw0Hnvz9vbnOnyZDc/RpalQ=; 20:nUVEDA3e0auZDqiheHXGL/YCBUCPSawmKd2lQe/vqAVtmaPQOL8SMy9weU0DAof7m7RUY2GKscgjFhp55f0hQtPs/a+3IcpnRT2rsoBrWoTD4WQCQHKPi6Jmj6myvvWxINprEkLQjUxp6B9ddiNtaw60GEruagzUKJT7DTvWam+kB1rv5KfeMnEOqZRp1fPDU2M+y4k5RQYADGhoy1mWkkakMc1t7pyRIoJKA+wmD9H3foSilhzfhf2Cv7WwaiEUGATL0zdlb5pdLg4MzzO44Ey1xM+Hbouczn37fJW5dx6ry8Ps02GDQrObexQHqPoUKk62yDUbUl/amD5h5dD68J+M21MKTLbkJT819gG2QJlbmAsLlRcpA1YYUB5c5GXoynNaHkhwPGoP4EC1T7JVRiSO82tqxceW7f6d5kQww3edLpXDnNzRtYbUSNMwC2pinQRqbAenoWls7DZgHDU07LaPDZNAZ7xCI6aBN+KQpwUoCWgXAO5apCwAMK2LUlRj 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)(100000703101)(100105400095)(93006095)(93004095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR02MB1339; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR02MB1339; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1339; 4:uBTtHRqEjfE4zu6dS6ZLUr+twhq/JaPcCBqM6SwBeSotc5WoEsH6RQMkQVA3e+HyUj2wJE4MSX7fX8wlqWJ6vcr2tc6VQbZXetQuEcRqkWb9408kYg27RQCGb77ul+XPg0LjDoJeXpf0o/PXilmFZ8rgl5Xyn5zwFnZM1IZWIVW5PDmhYBbmiEQpowVQ42YEx2k1NByGwDk8GqFRyYonbt5IVAr2cl9I1lqzI8ugaTGF4T9gJpcsF2PYhf1Y/XfidXYnuDG88KUZ/H6Q+9DrKRET6B8AqsCWfCwCJxU1/wBBXyZsQPaWWQHEHRiS62Hq0IebfTukjzLdqzeLDcZxsQ== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR02MB1339; 23:tMle42QmMOP+rYnmig8qhcFBhXZd2CjRdE4MYlUiS?= =?us-ascii?Q?YdxXeZw33y2v70KdyumD0UZI7YmHXFIT6NMMo0OZ/1r8/h7iY3YD1U589v2R?= =?us-ascii?Q?S+t8xeRm3vAnq1CoaML6YfyrxVU8NQVnnZuKn3Uq6fjCStorEQXuT3Dk36Ni?= =?us-ascii?Q?uuqHCRFIHnS3TpOw7HaewkhDQ0m6VdPISa6BTbd+g2bKAR31k/zbnB8vw7iP?= =?us-ascii?Q?wEKB/FOOPN8joYIR0fU0iLIdE86fcZU/kCy0iyyZVp4QiX1x386r762zWw1o?= =?us-ascii?Q?OihZcaphT9/4d4lnC9z1CAnwjvem8+7PdlHJKXvukf9kWvwEjjzkZ+z8ZMzq?= =?us-ascii?Q?0NKzsOIkIiH/Sfpx1w4JHyzpyrTq7IyBhvtErReeKWDi6a11IScTebLnPKbd?= =?us-ascii?Q?PDX6CxoyXbqwsp4u+FUS4jffqT75GlD+Pk+WWl35iWdF3JUzuL5OXTvN1eNS?= =?us-ascii?Q?rXg0LhBkKSfAZ8Ye4bk3O7whFclDiypVfh+QIIsIYNyvM0uVd9+ihw+19Luy?= =?us-ascii?Q?ijRojoGfXW+LCLd6TBXNJFbGLyF06x6bqpWvG5BeCTUrpD8AZRIjscAsXKjI?= =?us-ascii?Q?yGQQlOYu5e4aAmUI6p+fgyzq0HcjcGjyZwbpIXp6cexhSI9GvMr2k/bu/yND?= =?us-ascii?Q?BY7ZrwyNig9jlcPZaXlARBNKIQpNWLFz0vp1jkoCjbw4ZUFdhK0YqoxSb1To?= =?us-ascii?Q?IcuT44m7pEDZg3LtoKat2WHlPVgJ8H9uiAN60rfDyWwE/BsHZSv7M9UjFxZB?= =?us-ascii?Q?yvOH8xtS1fYiSEgy7Si9fUpVw020Y8O6xZRguxD0c2ye+Wp98uTFhybzCaat?= =?us-ascii?Q?kgxe6fAtpT801RqDVde+g9+1pAJGYl21dwCORetDOPlsCbkJgqUe6cQfheSB?= =?us-ascii?Q?Q6Kd/Tai8DVkqVEVkwP7eChe8kmun4fNjq+A6/Emf5MmMdfB0xq+9AzdWOCu?= =?us-ascii?Q?3DmRU9Renw1HUu9oa4Me8o0aSCxpO8OiV+JPpM3h1r+AiUkXD+LL3USRhZHl?= =?us-ascii?Q?AwZSjtfrKWdtxxK56k+4Ub+rnWXalsV8atZq0nNunnd1hjhgi2fuZOMIBw7b?= =?us-ascii?Q?n8IpAj6wV70haWn7AblSIjALh18PJgBK64/wUx7Rh0vhAWhDg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1339; 6:oElUYHJ30JHsRzGiamL8phXGH/9wk+Tcg69YoPQvDdn4nbeH2gr1PAu7SqoFptVNg5YRLW973rbA5irZVwyPp3H1c0HgdWSkq/SuwRAqlntjN7Tu6kUEYaZ+zh/qL5wO2UeTAj88v/4qBPKOeeVNUtBPjqthyq3TI07LDvyXEILhJ1KAmtw1R8SVlB1Dv2GWZBpz2Qp43uH/a4q/r4KgmtvtwcpbMut7QIEk6k5IYNb/q0XAHdaXOfTqcYYf9fyvOAGWVVZGw2SVjlSZM/vkyli2KGpKCg/VTvQ7nsP0vpamcTzJNKinZ7m8vGpaKy7gbSX1MdA/VS27lATV5y608g==; 5:WTgia8byVjLXHAy/hZl7ffa33/CEav9Uv2erexIWfWc0001Uhh34NZHCwh7RFZQatKfwk/iNI7uljYbHfTwDNaFcq3gFI9KETBtjxyOwo5qYtH/lMpyMQXYk/Br0u5FZ6juseAI/P1VxdOJK8A24AA==; 24:6dnz2D7KzYiMJXaaDavR/tl9paiXx0hm/ombXqdW7OstS3sUZXxO47AdsJgvJrR/YAY1FbO52zqkIFMV/TH3AKXoN32dBzGApU9FHGcX6k4=; 7:+N4rgZXKqRY4VeWRZBFqgLceS+bvevnIaxMBX3w4rd80PBvmUZEYH0Z4QHndPKKP9IL2wZUOcn2sLpNzbW263VNO1X0FIoKzPtitqVUUc2AW24BpxubO6NySHDIzap65sSQySo61hd/lSDZXDjSeXh89U5herp/cf5jLSJZVXJpjIrxBOZCpOmKVOGHuZezVEiAbzi6Zfrep0lnODSMb0wMpZr+54ucs2YIFGGFU4sw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:16.3334 (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: DM2PR02MB1339 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.40.69 Subject: [Qemu-devel] [PATCH v3 42/46] util: 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: 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@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 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 5946ac09f0..29fff51fcf 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" @@ -703,8 +704,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..1207ef71d6 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("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("%s: %s", msg, strerror(err)); abort(); } =20 diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c index 94f3491a87..02b94e22da 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("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("%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