From patchwork Thu Oct 19 16:18:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828243 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="0gs9AQbj"; 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 3yHw2T058Xz9rxj for ; Fri, 20 Oct 2017 03:52:17 +1100 (AEDT) Received: from localhost ([::1]:50228 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E3L-00062y-1z for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:52:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DaQ-00065V-PS for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DaN-0002DK-HD for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:22 -0400 Received: from mail-sn1nam01on0043.outbound.protection.outlook.com ([104.47.32.43]:65360 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 1e5DaN-0002Ce-7M for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:19 -0400 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=G5IfF4IcxhR9wboSV7kSK6PE790zRa06K36F0SI8tXI=; b=0gs9AQbj/dwe64cu3MmwwXOexsJI5jtvI6vZY93ArAkbqAMT/OlFapTXpzTzQPxU9sGPJTGDEgX6n04fqpSHTXaz/+/saGl13CAzJZM0/RQeKXC3v2AS+L2xKPd6GH4WM7D0oDr7H0wu4YsrunnrsPYDt1hoKuAPBxcF7SoMYXk= Received: from BY2PR02CA0113.namprd02.prod.outlook.com (10.163.44.167) by BY2PR02MB1330.namprd02.prod.outlook.com (10.162.79.25) 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 BL2NAM02FT045.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::207) by BY2PR02CA0113.outlook.office365.com (2a01:111:e400:5261::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:22:16 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; 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; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT045.mail.protection.outlook.com (10.152.77.16) 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]:39544 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaJ-0007yU-KY; 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-H8; Thu, 19 Oct 2017 09:22:15 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGMDEf007108; Thu, 19 Oct 2017 09:22:14 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaH-0003IE-Pc; Thu, 19 Oct 2017 09:22:13 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:18:21 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(2950100002)(189998001)(5660300001)(81166006)(54906003)(8676002)(6916009)(8936002)(33646002)(118296001)(50226002)(478600001)(77096006)(106002)(81156014)(356003)(16586007)(36386004)(2906002)(2351001)(305945005)(4326008)(5003940100001)(316002)(63266004)(36756003)(50466002)(9786002)(76176999)(6666003)(47776003)(575784001)(48376002)(39060400002)(50986999)(106466001)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1330; 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; BL2NAM02FT045; 1:WcruRXF/bWn4zg0tAI+hKHdUXxD/7GT9z3j6VUdYR2aMTP8dDFzYyFynSvP4aTnes3R6BtqfXtCXCh+zSBwx7YjANmAwYHTmuEiDwVluB/+Em674gxr6A2bhFGyC9M+f MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8fd1efdf-c3e5-42ae-c306-08d5170d904f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BY2PR02MB1330; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 3:W6OALR1uvjzoWk3QopgEePF9AEi9cKxzLe52KZODpbGmuN698Usxf9u0luEq8ctVhm54giKDyuSTkkrrMB3Z9GfovjX042QnNfIcNTwBMmcqkPPN2IvkSLjvt9xIvak1xsmIdFDHqbW9TQejYkw/20qNc51Sgc+SjogHZzdEL8RtQ6UuNL0hDbT4O5AKyYdXSwFFFd2tX6keM2ILOk+aaUyo4kd/VTZZLI+K0zZjhdZcjM4ZetDv1yO1NlzMl+JQHUDLXZfygDmGZbfeIZNaFO/p9tBvgWHa7QMhBy6FPTxXU7x3EMTvAH71ynKLPg5dgKaeqt/VrafEabzY99+v09j+K0RKZnYifGiuvzqEpSI=; 25:Xut70NjCyxZOGcnHAnuk/doGK5fIsIYhFEmekMbP8h8bfVG3p/Zyr7iiM7PCH/5CXK4QJEjQSl4CMQ2sfhDqEV5e+vBbGN1dgd8a9Fb/UlFIkb/UaPl0nkfl52vJutmZj+vkqycINBPNrNhd3n0Xrp+E6UItZ2uFo8beT2+puF5eRrpirgx3TK0iH76RI+C+LlEXLrWB88s+K9q93BAF0gnb8zaq6FWUXwlsfD04dwIXjvQdUSrflhREiGtrW3bgqkaAONZIQEJkWeJwzvXpn/U+RmXE4sDBownCbrpkSReMCuTa5KmdZziTiTq6DpbojlOdRWfml6AEj8OH4Bohrg== X-MS-TrafficTypeDiagnostic: BY2PR02MB1330: X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 31:O9O7FIC6eHXCBOSImQsMroVUivovlXhlGr8hP4csP4nGbsfSElIb/N9J1Iv2HELaX5rZYYo693Rws7aLV8pOyabbbOCJca+FSCGr6tQ4MtNOghfoF7IB4LolBQBjgd9bEMpbTa9eKD8gvhkuyKfEf8Z5KQmQfkqi2LFk/AM8xKyq4mEOzuMSUoQ7PP52JGhgruvzFk3PxM76Yjv7x+rmFvG6CgcraaKMShMZptw9HpM=; 20:8ahqlTF1FkPDsXwHnaJAS8Y+eGju1JzUB7EQdzU/yeq/SqSmfAUjEWuAGbaiD2NNRHFNfG+5n9a415freVwMf54SMnQ7FdYPvoIWUM+YnqiNWVOUNesypTYAv7icoF+td8WJ8UMRQOOmr9SnZWAGhhBiWxSfoJQIxGA2GRtHianDuT8ija+zmvuZ+rcHssuAGLuQ7F3Y0l9TAIo5rNNYmUTqIa346Bkg1Kp+CswjmXyl5B7IrkZjH/Wtd5xhII/Wg2p05YSCRPmnPOmN3Ryt16BshbV09LFybcvQnstgLdro1+xwVfGHRtwrJdbfJumbyQj2dJId14Uafi5/kV3vif5QTKmaUWF/Llgvm4F8Zo7ZRJYavlw4dhG4GRVv+eWtQ/5Ww03XKuuRKJnBHWsas9Ht2W0Pa38IuscK4SPETpYDNmdrF8kzmJzJe5owIi1XhQDZ8uofVB3pWeIvCM7CcNRf1Q2WOZ/TK6drP7MRqRPPCKKaDqR10MHKC3iJLAo9 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)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93004095)(6055026)(6041248)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR02MB1330; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR02MB1330; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 4:TTn2Q40rgv9ddLmtw+T+BBrZ9hK2PSREfVPhXt/GP3oT0qDavQ33jPV/CYj+cWk8EcFBU9rSGOGqdgbKvPU1ldNMBUTWLtfh9FOBK+9kMHH4D8FibyEYRWrDHNRm79BAixetQNv2oYF4J4JHu2PlleBPu58s4jldhdRecvZpu0lSk6L8oP/rePP6mMGy02oxVVcmMXT1rBOzuoqToHNpepIDHMEp+PtQVU2t+jno2Z+LqrtQiEY58phJgujN4vbJinY/iZnBW0dcIXX9FDTDOSt+/PKJBZrfD9Ndv0CUOvz/U7cnxeE0KkZFlVlT/jlCcbwAGdeKDWODitmcGDNjnw== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR02MB1330; 23:KbXENoDoujqoE9xJ8v7muQdXdse0xsxO4p3J5ykU8?= IqL5eBjrdlNuKhP4LfUNPme1e0+p8ZocMFfaPZ6rdiQu0gn245CmIIlDZnpD1zjEh8A41avGM1UmVDKNGk4mbHZ9349VAN68ASrhuFEqumIOuQ8YEIPOyERur9LO6SOzYqnmfjoYxr6Q2+GOodRqWvPqzM9hHx+5QQMCdJnmrIOOaPqj33CYM1GAwNMUhWvsCN9urim5ATYyFw8AkYcpdxVLn1hcM8YrTLosvuyY/IJiv2bozrq0jXpl0Q/eQUbcaDoqcAsx5penl5BKsJCAovXuHo0E8apRgPNSqKjr8JJNhDWM7eaDHF9PdYWfRnUj2YbrZdi4UEBRQDICRO/Rc8TUkOIYvV+Cx/kCuAFrpXfA2d8FpbO7T1mYPHieqvo50M03Uvjd/pxjGIb48ZSRJCsyqxrYRAbyTcg1ovGIWcCFSzAT2C361yMeiYaIKF9jvQBKRplB0xZ8NjA5pwplrweRaUsb7GlHHz3ydTpxxMRxkbQWWERe4z3pjQeXVvhWIfPtRcygWpcddOZmbUR6gBBrV8lohR0yH7AW97bBxDTxkrY65pTeh8R/+3Yaf9upBPmhFUb6N/KTeaArLJ/AcWQnltC+UBC1dsyydl7uBq1cQCL0rvXHppRo6onQ7zNIWo2eRTSUcf/sI6O6kt/gfwhfxdwrFVOMqeWZc5qpG2aVt9Jp6k5wy5ZYcT/NmglU5pqKUlFbq6PFoy54ZlC/DYndusmwlm8Lmoc/OvLjep3fjfBQkyT7mnVH4R3gNhMeb4AygyNFGCBuDABwic/Mle7VBLZN5wulT+rCuIFpH5GBz33krmdfiA9Mwa2tMlUfhN8E4PR6J1Ctu8Jy1/z9Js22dquPmPxqEBB8mxfF0SCUonVTpQ3bXuUZYi4SWIilb4EqGCvX8kHc4f/axnUsqml1g82AYZpc/GpAWxq/SRGiuAU1uiP4HOxSqr4Igjkc1Wya/a5QBiwyehOZT5LgcYsCGuerDwB64tWAZZQ/9OoEAF6bt8nk8HUtzdPjmtAA1PQgdJTBJnkPCO2UBti2rIY/mTP/6MANXdRSW5/Kxg4qw== X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 6:Nd1TzdKu+mRNWzjYB/8ij5THE+q5S9FiBa1ubh7Jtv1HQqX2XqeZD2L9raVM8ECn236tyrtNjjCwX/FkVqPa7vvlV0U+UYg2gvu9e6xoO8TfXm1YGxRv5DomMKSwjbpzMaAYF4X8GwZzlIlzA5PArK8IbHXzABkkg2fupZpiV2UhSFt/Re7quEoGMoOlqoY2CDdE0R+krEuiVIeopnNi/TewmKZXE37c2A1JhA7tRwWaREMvCkt9YKkU3T7vWNpTTAk4JoU04XZMNeRKhmHcQBys+59KDzVevRvx4GNCIUsV94XwX+YQrNoFlT8IhbDPqDaYbVeutOvpe6aRayB59A==; 5:iFNQIGlw03hvsLfeZW93fPZdF/E6OrG6N3eQTcftuLAafS+hkOOxEDX6BgObBoH9CadvkQfL0lyfrAkKWeEmQUl6Jj+1jW+HOU8oEtMXzjAtcJ5WlSPUci3xucLmKfT32Hm4/f9jZwquWACJc7euUQ==; 24:23neIhIohYYLmYXuKa9kv6cbmKE3Bm1z0AjVglTtp6cTWTsLROrirlgmv21zX25IpRwZ7i4F82A7uFFuar2gw+nBqaKEJA8BXL0n++sxZvw=; 7:i4h66QfZs35AQw0mzyVQMWAYcu6ptIAkuJEmO+IyLjlujJadgGDQwqk4HH/ZIddiG9nXb5jVh/E9CRLLdZEcOp9NLSTVNaz0qiSf/IAU3RZUrJRRIPx7Y/vHX16QTLCYv4PAT5PVtqLDtqmAzR8PE/IXbNRO/WLx+zOO5OSkTuanJ6PVMqvDMooSkqd3xy08sc8pBRreFsHpyOlBfas9gUIG8QRryAG01LW3KMB3AKM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:16.2515 (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: BY2PR02MB1330 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.43 Subject: [Qemu-devel] [PATCH v3 43/46] 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 93e56d0518..62c021c5d3 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]; @@ -908,7 +908,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); } @@ -917,7 +917,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 b82c27960a..56d0ebcb50 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1417,7 +1417,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 1ffddbef3b..cecaa4876f 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" @@ -85,9 +86,9 @@ 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; } @@ -110,7 +111,7 @@ 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 346fff44f4..8cf126e7b0 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