From patchwork Wed Nov 8 22:58:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 836079 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="X4nF+5dH"; 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 3yXN1P1Yf5z9s4q for ; Thu, 9 Nov 2017 10:34:33 +1100 (AEDT) Received: from localhost ([::1]:34464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCZrb-0000Ug-9y for incoming@patchwork.ozlabs.org; Wed, 08 Nov 2017 18:34:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCZNE-000146-B5 for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:03:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCZNB-0003qC-3y for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:03:08 -0500 Received: from mail-cys01nam02on0067.outbound.protection.outlook.com ([104.47.37.67]:6176 helo=NAM02-CY1-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 1eCZNA-0003po-OW for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:03:05 -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=kVhcx6UKvmQCDwqXlz4mOIxeNq1U8jBFrKsPfVRtnh8=; b=X4nF+5dHXjK7+k0km2ElBCOZkvkqbeqmVChmrSKcyydo4G7XO3L1eRnNRC18lhjsY6ph+RX4gyCtZm+0WW+BtF1mho9MtYdTeeGefl7BmFZG9s+U1mjzKmDTucquIk4nbFf7sEXjOjnwjXm1p6AuIIZPwyxs+R8XieEYu5oH05U= Received: from MWHPR0201CA0017.namprd02.prod.outlook.com (10.167.160.158) by MWHPR02MB3392.namprd02.prod.outlook.com (10.164.192.11) 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:03:01 +0000 Received: from CY1NAM02FT034.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::209) by MWHPR0201CA0017.outlook.office365.com (2603:10b6:301:74::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.218.12 via Frontend Transport; Wed, 8 Nov 2017 23:03:00 +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 CY1NAM02FT034.mail.protection.outlook.com (10.152.75.190) 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:03:00 +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 1eCZN5-0001Nk-Dj; Wed, 08 Nov 2017 15:02:59 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1eCZN5-0003BM-AS; Wed, 08 Nov 2017 15:02:59 -0800 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 vA8N2v5i010572; Wed, 8 Nov 2017 15:02:58 -0800 Received: from [172.19.2.220] (helo=xsjalistai50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1eCZN3-0003B1-IN; Wed, 08 Nov 2017 15:02:57 -0800 From: Alistair Francis To: Date: Wed, 8 Nov 2017 14:58:59 -0800 Message-ID: <3c6c24cb01f7d4812addd84bd170337459c9e95b.1510181732.git.alistair.francis@xilinx.com> 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)(6916009)(4326008)(118296001)(39060400002)(36756003)(575784001)(16586007)(316002)(50226002)(50986999)(76176999)(478600001)(5003940100001)(36386004)(63266004)(356003)(305945005)(47776003)(106466001)(189998001)(81156014)(106002)(81166006)(77096006)(2906002)(33646002)(9786002)(2950100002)(5660300001)(8936002)(50466002)(48376002)(8676002)(54906003)(2351001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB3392; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT034; 1:AlOXUxj7h7h2+SEHBMFXtrzc8meVj1IXKKZ6+zEkopRfU4QD68e4h1QlfIMPSTPi8QCH+xsPScyaCKGltcvZaWFuaXFpBG2mvH3MW5OHBPUkS2A77QGcf+NU9TrI6DEL MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f204f7e7-ea58-4b57-855a-08d526fcdbe6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603249); SRVR:MWHPR02MB3392; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3392; 3:oJbFUW1xZsRsdaC/vmkEWvvWFM9PxvCLG0Ylr8O5FfpXkUcMuS5S+eXDRPVnIhbx1DqRO0OxFlIX28GlQesrRjwEWw0+782Su8CGejU5U6XK1dYoLK11T/4Cu47zvlgMDVE9XHuQm3e2E2jlRt3sWYtOLrLvqF/yfzz4vpThpthfe3vJvI2WJK/cu2JMNMS99mTJrR9xjlJGoA2Oc74znSaP7vWILnNDmyD3tSTL/yOB2KOM/bBGCf73hi2SZq8C1x9Dz15kNtg0ljmFSzrqddAI2suWBh/ZC2buwr7veMIORtsXR0BKmzHoSBtkOjakCh08xhnxWefSSNmxfCobNE5AEEDP5VwpcUc5P1P/Stw=; 25:FL153zo4Mtmw3+5kTi/VdzsTx9BtN6Ewy+K4REIkWpSKGRa9HIqwqNe+PeO58FBYfGXo82YOLgiOO2vqF79Z5u+/jXEZ+39jMIG+YMGwPmNOFqDGetiUwbtbxt/M2yCiDhBHBokp/PLkbWpBvIrp5ytfjTXAf/RLF+OTx9vujlPfhrfiNW8mSPswnNyhu2tyI/cffQOy5PAmBcxXeIWKoMeib2rigPxB3JCKPvcSP9Bmc4HUJb2uKzqagWBMhng3xN5Cy5nkWUEiG1PIDjmn4Zf1X05QifCItOKMvmsLTZ0kE3jQkp9FB99HC+uNTasUmO6/WbbxTpWznNO5kk8zow== X-MS-TrafficTypeDiagnostic: MWHPR02MB3392: X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3392; 31:yCd7k8WIx8rpsbaGuK4sYzMzeNG75EoTR284p5ffQneumKgIp4nUND0+z5doFJ85BxU7YG2x0zFk8sWEFollNts53BYjbLd8kgFVbzxmpiJjGehyyjbs/zgC1AougPi+kj3k1oqZMuiDKzuElndZjIXW6rZ895XHhmRK9oi6zXumDXf0idlK9CDk5eThviI8rQT/fGRjt2wTMqVASYkwgmck/kTKY7zkMfsWehtCiLo=; 20:rAs4kbChaWsS9RUYyuRGGlQSIkn0KUOgLv1laPQwJfJHz6lJr2GtDnZT15DGxXK2fk4LtARs1E4yA0YLx0fe5F/MD7MGe3hCaSWUqP9eR9KmQ9kJo4dL7geoPmDEItFBPiU6wCbxM6dcD7I9WeWiEecf6C9s/FXgrCYFb0++I4IepM+dE2e3Ng1MRvRl3BQPBNuC9i5WWXtWt2oQ57hXzfflTiQZ7U8XL+evHBDY3wPJ2VKwPRaDYh2BmBft+LnObFoPDiUFJqjf4kNRriKCLawcZ/j6Y3Tqi9QVxm+PV2g6SEzovIsEiHV33eGlxzD8ZbV1HPJyUneVqDEa2XwFksFnOsxoR6tD7OVAnANTvCQwBAYoqmZHLaM8kUl4AUjF3MNdY77d1BsMjJxjALExA3d37rarSC43eZDE8Fxt1kNV7nl8PKRVgTgNu5EMXw/3IECwPdUZTQXREhKwBOesjCk+nP4ZU3RhrrPAawxJpGb3nDwOAO2+3lNRgThlbpJ5 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)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR02MB3392; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR02MB3392; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3392; 4:ogh4mlZSkf5tRT1+DUgTXvteTI3Iqs4u9UX+gdxNF3u9H1E8BxHpLiQUyWXzkaxeZVROGOxdHEIUo17pVIBsUiopm7XuL7K+Z0DvhNx2YPci105Xw9UztifIwiS+GdNHPTlWVWFXy3scHMlCC8IzU+jZrySCPFZLXEUX25l34sXjjltAl/iHwDme5Hj73AFOk+Xg7GJiiRkwBKc1bk6rguw/FUv3ow5L4fGO3wI99kg9dpFzcdg9PC5i18i90i1CGmKGj8vCEfq+0mtrj73pn6I72M49pA8xPeAQmGxk6HDcLoGsVIi5eLX4WHljgUPHgsXd/p37BbAYSvPQVPyOgw== X-Forefront-PRVS: 0485417665 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR02MB3392; 23:ZPyCpLafA1Uc9+//D6GgQtcjxtC8h3UUJX65T5QU1?= vkLp4F2A+jDTN16roCyaU1aRZiCEK6UKZfliTUl3bikdgMrSxX3wCsDGSFRNpHBIotEF140n/RYWBD8EIYwFjMC8SbScpz8OxKDT+SrpE3AQ6BsHK9yJZ2OUFq5gwmZZlD+GuqziF3H3kTzTf/KNfuay2r1u4p8fSz82EjIDmcCYf9pms/7SctykWoobvKxt2aVQNBoJTW89xYAfGxmcQGHf+PE0dCo2PbWUl1XY6p0iCCHxW5JZ/Hx8G/X47oRsrP0ggU20wCQl5TdaqaMH6iFQ6b0gMY1wIGCLtBZ9mW5531t8LN6SPT6LRZcsduRW7Qk2EQtjigBAS47gui7ECY4fEohfEtTdJY8UwirYPoa+TRAZhIfeGkGH5ES7uJRrEvZEEoP6uoexjFw4rpaU3P9Kdqww6+VwPH1X/G4HTVt9DN66Mktk5GZQejMHOmQdJrQErF32dr4uULdP4NJA6LGwApHY5Ts+oSe6bKzJ3QxRu+V25KPzDNzW4U/84Zyc2uOriGqNyItUfbIEEyNJ7Mlz8/+XSRUhfruSiXeEqJVTlwbeG+dzyAduURHhys8718F1zfikQJC2dzp00+Wv0qo5QKwmYi7uUPMuXOg3VI8xHVYc7/o5zJSMVL7HcSBIJE9+p6anrOfU/XAvwElqIhNQlkwSdn8LGvTVRXvTTeHXbgaJZK3BiY5BX9SnsQ4bQxA2V7+7jaH25oY+t8cjpw9ly53zG4ZuBTZkj2BjOXIBaQnJEvIjyKKGIYNk4AIeFmcKE6nDN74UYAd8hiDXqvqh/dL6Z3AIdm8kBrbjbO8JOHuL5RhUZb33FHhtaloSHulV9nREV6tmsg19Y+T0lad3QFF3bvFoKloU42Waj7vgekHHWm0sjMgV2kG50WPA84AlrPuWtLPJUy1uyZJdxRuyS6EnftFiiHcppcDl0mStP86+Fv053tG8t/PBlky0zkrI4onyPuTg91S/Js8GlH+xWKFdCzD95O1Lzkrm3+LCKr9vsWkVXjHyPsBPVuFs2g= X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3392; 6:EmqhNbnm7Qj5s5CkPWPhOsPmhVYpL7tLCx03b2cblswidXREPaqN/Pv941CbWXF/e1j4mqU+NlJJvy1ZDn9hSZHlww7cGNWLcg2HkH65FZl/J3b9TzX5uSJteXXtu4dRTAvsVZFhPuI4FHo3vAzxCc8RBh7X5fq1JmSGWU/uUekWE5VNEqDC14qA5cx4/aTSS5hK43+W5FsYeyln3gi1SfpDq32dCL3ayBoplwWOEXaYoa+iH64b1IYvjxR3M+WuD9gN9qKKn7kGFYOnnMd+vMrN2PQRYswzdAP50M4kzlE+XZ12tNCgASNNogprI3fTkqv0N55f4V18nh9ipzKRkFhINqMVw3ZyZGrNX3d4cz8=; 5:/cIn/MaK6zjDexZQ09US2yxRMLTM6V75b3+JTd+YnlJ5hitJnjFhYU8AlMPbk6hMJhYhZRltRXE8LKgVqX5N32YVNJs3WtUdCo+TeoGS9KQpg4uWDPtcHuFnCjP82r9G4gS4LehWWqk3c6iIDEhzOg+LUymQMwh0AasMwQ03QuM=; 24:hqaF95RpGv6eBNWkZGzpXSfIqKXME0/a/d9d1OqErmGwYOlmwtSNH3Vw6LoGc9NBIT7BfNcUYtfW4vcsEcnbrPrVc1IjECetbksFh41WdRE=; 7:OXR+tfVwpm0TlhtYMzh3jUwhTRmnwdpcpk16ihp26Pt/56nvCHCvwoIS8M4s+BzK1kxL92cQr5F8A8iZcRsvo3ZpWV2H0TY2akKASm8NJpeDZ8FzTuvEDL+l1LEuYcE5YOx2MVr4S+8zj3uBUogffzdRtMM5lixibXaO/goQX7Tw/cbAcXmpgBwa9oZGu/zXXfZUhYCO2HCMmAiZJbul+L4KEc5T3J8Wkxjt617l9nvWU0fwIIf3n3lolAB/grVd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2017 23:03:00.0568 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f204f7e7-ea58-4b57-855a-08d526fcdbe6 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: MWHPR02MB3392 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.67 Subject: [Qemu-devel] [PATCH v4 43/45] ui: 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: Peter Maydell , alistair23@gmail.com, Gerd Hoffmann , armbru@redhat.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}' \ {} + Signed-off-by: Alistair Francis Cc: Peter Maydell Cc: Gerd Hoffmann --- ui/cocoa.m | 6 +++--- ui/console.c | 2 +- ui/curses.c | 2 +- ui/cursor.c | 10 +++++----- ui/gtk.c | 10 +++++----- ui/input-linux.c | 3 ++- ui/keymaps.c | 4 ++-- ui/sdl.c | 14 +++++++------- ui/sdl2.c | 8 ++++---- ui/sdl_zoom.c | 3 ++- ui/shader.c | 9 +++++---- ui/spice-display.c | 10 +++++----- ui/vnc-enc-tight.c | 4 ++-- ui/vnc-enc-zlib.c | 4 ++-- ui/vnc-enc-zrle.c | 4 ++-- ui/vnc.c | 2 +- 16 files changed, 49 insertions(+), 46 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 330ccebf90..fd3686bfd1 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -235,7 +235,7 @@ const int mac_to_qkeycode_map[] = { static int cocoa_keycode_to_qemu(int keycode) { if (ARRAY_SIZE(mac_to_qkeycode_map) <= keycode) { - fprintf(stderr, "(cocoa) warning unknown keycode 0x%x\n", keycode); + error_report("(cocoa) warning unknown keycode 0x%x", keycode); return 0; } return mac_to_qkeycode_map[keycode]; @@ -945,7 +945,7 @@ QemuCocoaView *cocoaView; // create a view and add it to the window cocoaView = [[QemuCocoaView alloc] initWithFrame:NSMakeRect(0.0, 0.0, 640.0, 480.0)]; if(!cocoaView) { - fprintf(stderr, "(cocoa) can't create a view\n"); + error_report("(cocoa) can't create a view"); exit(1); } @@ -954,7 +954,7 @@ QemuCocoaView *cocoaView; styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskMiniaturizable|NSWindowStyleMaskClosable backing:NSBackingStoreBuffered defer:NO]; if(!normalWindow) { - fprintf(stderr, "(cocoa) can't create window\n"); + error_report("(cocoa) can't create window"); exit(1); } [normalWindow setAcceptsMouseMovedEvents:YES]; diff --git a/ui/console.c b/ui/console.c index eca854cbd5..b58336c7b2 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1422,7 +1422,7 @@ void register_displaychangelistener(DisplayChangeListener *dcl) /* display has opengl support */ assert(dcl->con); if (dcl->con->gl) { - fprintf(stderr, "can't register two opengl displays (%s, %s)\n", + error_report("can't register two opengl displays (%s, %s)", dcl->ops->dpy_name, dcl->con->gl->ops->dpy_name); exit(1); } diff --git a/ui/curses.c b/ui/curses.c index 85503876c0..11c862520f 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -438,7 +438,7 @@ void curses_display_init(DisplayState *ds, int full_screen) { #ifndef _WIN32 if (!isatty(1)) { - fprintf(stderr, "We need a terminal output\n"); + error_report("We need a terminal output"); exit(1); } #endif diff --git a/ui/cursor.c b/ui/cursor.c index f3da0cee79..9d847031ec 100644 --- a/ui/cursor.c +++ b/ui/cursor.c @@ -18,12 +18,12 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[]) /* parse header line: width, height, #colors, #chars */ if (sscanf(xpm[line], "%u %u %u %u", &width, &height, &colors, &chars) != 4) { - fprintf(stderr, "%s: header parse error: \"%s\"\n", - __func__, xpm[line]); + error_report("%s: header parse error: \"%s\"", + __func__, xpm[line]); return NULL; } if (chars != 1) { - fprintf(stderr, "%s: chars != 1 not supported\n", __func__); + error_report("%s: chars != 1 not supported", __func__); return NULL; } line++; @@ -40,7 +40,7 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[]) continue; } } - fprintf(stderr, "%s: color parse error: \"%s\"\n", + error_report("%s: color parse error: \"%s\"", __func__, xpm[line]); return NULL; } @@ -75,7 +75,7 @@ void cursor_print_ascii_art(QEMUCursor *c, const char *prefix) fprintf(stderr, "o"); /* other */ } } - fprintf(stderr, "|\n"); + error_report("|"); } } diff --git a/ui/gtk.c b/ui/gtk.c index 342e96fbe9..91b269d9d0 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1254,7 +1254,7 @@ static gboolean gd_win_grab(void *opaque) { VirtualConsole *vc = opaque; - fprintf(stderr, "%s: %s\n", __func__, vc->label); + error_report("%s: %s", __func__, vc->label); if (vc->s->ptr_owner) { gd_ungrab_pointer(vc->s); } else { @@ -2215,12 +2215,12 @@ static void gd_set_keycode_type(GtkDisplayState *s) keycodes = XGetAtomName(x11_display, desc->names->keycodes); } if (keycodes == NULL) { - fprintf(stderr, "could not lookup keycode name\n"); + error_report("could not lookup keycode name"); } else if (strstart(keycodes, "evdev", NULL)) { s->has_evdev = true; } else if (!strstart(keycodes, "xfree86", NULL)) { - fprintf(stderr, "unknown keycodes `%s', please report to " - "qemu-devel@nongnu.org\n", keycodes); + error_report("unknown keycodes `%s', please report to " + "qemu-devel@nongnu.org", keycodes); } if (desc) { @@ -2244,7 +2244,7 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover) GdkDisplay *window_display; if (!gtkinit) { - fprintf(stderr, "gtk initialization failed\n"); + error_report("gtk initialization failed"); exit(1); } diff --git a/ui/input-linux.c b/ui/input-linux.c index 9720333b2c..edc5273476 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -5,6 +5,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "qemu/config-file.h" @@ -241,7 +242,7 @@ static void input_linux_event(void *opaque) rc = read(il->fd, &p[il->read_offset], read_size); if (rc != read_size) { if (rc < 0 && errno != EAGAIN) { - fprintf(stderr, "%s: read: %s\n", __func__, strerror(errno)); + error_report("%s: read: %s", __func__, strerror(errno)); qemu_set_fd_handler(il->fd, NULL, NULL, NULL); close(il->fd); } else if (rc > 0) { diff --git a/ui/keymaps.c b/ui/keymaps.c index f9762d1497..41c5e42553 100644 --- a/ui/keymaps.c +++ b/ui/keymaps.c @@ -105,7 +105,7 @@ static kbd_layout_t *parse_keyboard_layout(const name2keysym_t *table, f = filename ? fopen(filename, "r") : NULL; g_free(filename); if (!f) { - fprintf(stderr, "Could not read keymap file: '%s'\n", language); + error_report("Could not read keymap file: '%s'", language); return NULL; } @@ -150,7 +150,7 @@ static kbd_layout_t *parse_keyboard_layout(const name2keysym_t *table, if (strstr(rest, "numlock")) { add_to_key_range(&k->keypad_range, keycode); add_to_key_range(&k->numlock_range, keysym); - /* fprintf(stderr, "keypad keysym %04x keycode %d\n", + /* error_report("keypad keysym %04x keycode %d", keysym, keycode); */ } diff --git a/ui/sdl.c b/ui/sdl.c index 7b71a9ac58..29db4c68ad 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -91,7 +91,7 @@ static void sdl_update(DisplayChangeListener *dcl, SDL_BlitSurface(guest_screen, &rec, real_screen, &rec); } else { if (sdl_zoom_blit(guest_screen, real_screen, SMOOTHING_ON, &rec) < 0) { - fprintf(stderr, "Zoom blit failed\n"); + error_report("Zoom blit failed"); exit(1); } } @@ -120,7 +120,7 @@ static void do_sdl_resize(int width, int height, int bpp) tmp_screen = SDL_SetVideoMode(width, height, bpp, flags); if (!real_screen) { if (!tmp_screen) { - fprintf(stderr, "Could not open SDL display (%dx%dx%d): %s\n", + error_report("Could not open SDL display (%dx%dx%d): %s", width, height, bpp, SDL_GetError()); exit(1); } @@ -130,7 +130,7 @@ static void do_sdl_resize(int width, int height, int bpp) * resolution failed. */ if (!tmp_screen) { - fprintf(stderr, "Failed to set SDL display (%dx%dx%d): %s\n", + error_report("Failed to set SDL display (%dx%dx%d): %s", width, height, bpp, SDL_GetError()); return; } @@ -241,12 +241,12 @@ static int check_for_evdev(void) XkbKeycodesNameMask, desc) == Success)) { keycodes = XGetAtomName(info.info.x11.display, desc->names->keycodes); if (keycodes == NULL) { - fprintf(stderr, "could not lookup keycode name\n"); + error_report("could not lookup keycode name"); } else if (strstart(keycodes, "evdev", NULL)) { has_evdev = 1; } else if (!strstart(keycodes, "xfree86", NULL)) { - fprintf(stderr, "unknown keycodes `%s', please report to " - "qemu-devel@nongnu.org\n", keycodes); + error_report("unknown keycodes `%s', please report to " + "qemu-devel@nongnu.org", keycodes); } } @@ -988,7 +988,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE; if (SDL_Init (flags)) { - fprintf(stderr, "Could not initialize SDL(%s) - exiting\n", + error_report("Could not initialize SDL(%s) - exiting", SDL_GetError()); exit(1); } diff --git a/ui/sdl2.c b/ui/sdl2.c index 53dd447fd2..f6700e70f5 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -400,7 +400,7 @@ static void handle_keydown(SDL_Event *ev) 160); height = (surface_height(scon->surface) * width) / surface_width(scon->surface); - fprintf(stderr, "%s: scale to %dx%d\n", + error_report("%s: scale to %dx%d", __func__, width, height); sdl_scale(scon, width, height); sdl2_redraw(scon); @@ -686,13 +686,13 @@ static void sdl_mouse_define(DisplayChangeListener *dcl, 0xff0000, 0x00ff00, 0xff, 0xff000000); if (!guest_sprite_surface) { - fprintf(stderr, "Failed to make rgb surface from %p\n", c); + error_report("Failed to make rgb surface from %p", c); return; } guest_sprite = SDL_CreateColorCursor(guest_sprite_surface, c->hot_x, c->hot_y); if (!guest_sprite) { - fprintf(stderr, "Failed to make color cursor from %p\n", c); + error_report("Failed to make color cursor from %p", c); return; } if (guest_cursor && @@ -783,7 +783,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE; if (SDL_Init(flags)) { - fprintf(stderr, "Could not initialize SDL(%s) - exiting\n", + error_report("Could not initialize SDL(%s) - exiting", SDL_GetError()); exit(1); } diff --git a/ui/sdl_zoom.c b/ui/sdl_zoom.c index b96196bac5..bf73d1f1f9 100644 --- a/ui/sdl_zoom.c +++ b/ui/sdl_zoom.c @@ -12,6 +12,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "sdl_zoom.h" static void sdl_zoom_rgb16(SDL_Surface *src, SDL_Surface *dst, int smooth, @@ -81,7 +82,7 @@ int sdl_zoom_blit(SDL_Surface *src_sfc, SDL_Surface *dst_sfc, int smooth, else if (src_sfc->format->BitsPerPixel == 16) sdl_zoom_rgb16(src_sfc, dst_sfc, smooth, &zoom); else { - fprintf(stderr, "pixel format not supported\n"); + error_report("pixel format not supported"); return -1; } diff --git a/ui/shader.c b/ui/shader.c index 008458bf94..54afd3fbb6 100644 --- a/ui/shader.c +++ b/ui/shader.c @@ -25,6 +25,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "ui/shader.h" @@ -96,9 +97,9 @@ static GLuint qemu_gl_create_compile_shader(GLenum type, const GLchar *src) glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length); errmsg = g_malloc(length); glGetShaderInfoLog(shader, length, &length, errmsg); - fprintf(stderr, "%s: compile %s error\n%s\n", __func__, - (type == GL_VERTEX_SHADER) ? "vertex" : "fragment", - errmsg); + error_report("%s: compile %s error: %s", __func__, + (type == GL_VERTEX_SHADER) ? "vertex" : "fragment", + errmsg); g_free(errmsg); return 0; } @@ -121,7 +122,7 @@ static GLuint qemu_gl_create_link_program(GLuint vert, GLuint frag) glGetProgramiv(program, GL_INFO_LOG_LENGTH, &length); errmsg = g_malloc(length); glGetProgramInfoLog(program, length, &length, errmsg); - fprintf(stderr, "%s: link program: %s\n", __func__, errmsg); + error_report("%s: link program: %s", __func__, errmsg); g_free(errmsg); return 0; } diff --git a/ui/spice-display.c b/ui/spice-display.c index 586f058f1b..bb6a1af68e 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -630,13 +630,13 @@ static int interface_req_cursor_notification(QXLInstance *sin) static void interface_notify_update(QXLInstance *sin, uint32_t update_id) { - fprintf(stderr, "%s: abort()\n", __func__); + error_report("%s: abort()", __func__); abort(); } static int interface_flush_resources(QXLInstance *sin) { - fprintf(stderr, "%s: abort()\n", __func__); + error_report("%s: abort()", __func__); abort(); return 0; } @@ -646,7 +646,7 @@ static void interface_update_area_complete(QXLInstance *sin, QXLRect *dirty, uint32_t num_updated_rects) { /* should never be called, used in qxl native mode only */ - fprintf(stderr, "%s: abort()\n", __func__); + error_report("%s: abort()", __func__); abort(); } @@ -671,7 +671,7 @@ static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token) #endif default: /* should never be called, used in qxl native mode only */ - fprintf(stderr, "%s: abort()\n", __func__); + error_report("%s: abort()", __func__); abort(); } g_free(cookie); @@ -955,7 +955,7 @@ static void qemu_spice_gl_scanout_texture(DisplayChangeListener *dcl, assert(tex_id); fd = egl_get_fd_for_texture(tex_id, &stride, &fourcc); if (fd < 0) { - fprintf(stderr, "%s: failed to get fd for texture\n", __func__); + error_report("%s: failed to get fd for texture", __func__); return; } dprint(1, "%s: %dx%d (stride %d, fourcc 0x%x)\n", __func__, diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index f38aceb4da..7ac957057d 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c @@ -800,7 +800,7 @@ static int tight_init_stream(VncState *vs, int stream_id, MAX_MEM_LEVEL, strategy); if (err != Z_OK) { - fprintf(stderr, "VNC: error initializing zlib\n"); + error_report("VNC: error initializing zlib"); return -1; } @@ -865,7 +865,7 @@ static int tight_compress_data(VncState *vs, int stream_id, size_t bytes, /* start encoding */ if (deflate(zstream, Z_SYNC_FLUSH) != Z_OK) { - fprintf(stderr, "VNC: error during tight compression\n"); + error_report("VNC: error during tight compression"); return -1; } diff --git a/ui/vnc-enc-zlib.c b/ui/vnc-enc-zlib.c index 33e9df2f6a..437cfb1307 100644 --- a/ui/vnc-enc-zlib.c +++ b/ui/vnc-enc-zlib.c @@ -80,7 +80,7 @@ static int vnc_zlib_stop(VncState *vs) MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY); if (err != Z_OK) { - fprintf(stderr, "VNC: error initializing zlib\n"); + error_report("VNC: error initializing zlib"); return -1; } @@ -109,7 +109,7 @@ static int vnc_zlib_stop(VncState *vs) // start encoding if (deflate(zstream, Z_SYNC_FLUSH) != Z_OK) { - fprintf(stderr, "VNC: error during zlib compression\n"); + error_report("VNC: error during zlib compression"); return -1; } diff --git a/ui/vnc-enc-zrle.c b/ui/vnc-enc-zrle.c index fd63d4f688..a3af8a1c5d 100644 --- a/ui/vnc-enc-zrle.c +++ b/ui/vnc-enc-zrle.c @@ -85,7 +85,7 @@ static int zrle_compress_data(VncState *vs, int level) MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY); if (err != Z_OK) { - fprintf(stderr, "VNC: error initializing zlib\n"); + error_report("VNC: error initializing zlib"); return -1; } @@ -104,7 +104,7 @@ static int zrle_compress_data(VncState *vs, int level) /* start encoding */ if (deflate(zstream, Z_SYNC_FLUSH) != Z_OK) { - fprintf(stderr, "VNC: error during zrle compression\n"); + error_report("VNC: error during zrle compression"); return -1; } diff --git a/ui/vnc.c b/ui/vnc.c index 9f8d5a1b1f..05fd3922a5 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -71,7 +71,7 @@ static void vnc_set_share_mode(VncState *vs, VncShareMode mode) [VNC_SHARE_MODE_EXCLUSIVE] = "exclusive", [VNC_SHARE_MODE_DISCONNECTED] = "disconnected", }; - fprintf(stderr, "%s/%p: %s -> %s\n", __func__, + error_report("%s/%p: %s -> %s", __func__, vs->ioc, mn[vs->share_mode], mn[mode]); #endif