From patchwork Tue Sep 26 00:09:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 818411 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="VoZBaFhL"; 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 3y1M483mDwz9sRm for ; Tue, 26 Sep 2017 10:18:16 +1000 (AEST) Received: from localhost ([::1]:44926 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwdZm-0006dF-GW for incoming@patchwork.ozlabs.org; Mon, 25 Sep 2017 20:18:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwdUr-00030b-De for qemu-devel@nongnu.org; Mon, 25 Sep 2017 20:13:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwdUn-0005ic-Fx for qemu-devel@nongnu.org; Mon, 25 Sep 2017 20:13:09 -0400 Received: from mail-sn1nam01on0051.outbound.protection.outlook.com ([104.47.32.51]:10976 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 1dwdUn-0005hp-59 for qemu-devel@nongnu.org; Mon, 25 Sep 2017 20:13:05 -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=2JrqJ4pgsVddS+P1MB3YSHkRGOUdJRPRozNIscjfoe4=; b=VoZBaFhLFf9olRj/0p9DuRorAajgnpoZ5O4lWcfym+2AOeIwU+hqWryHeK0IFsA8CzrM3CHI5WOgwZ+b6VXpNGDxmYfyhBw7Qf08dEoDODOSdbEXgfCnNWHSbaAJGXueyM0wWBw+Jn/VJc2MLIgbGa8WY7zWpXLSszOn6qd4778= Received: from MWHPR02CA0050.namprd02.prod.outlook.com (10.164.133.39) by BLUPR02MB1122.namprd02.prod.outlook.com (10.163.79.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 26 Sep 2017 00:12:55 +0000 Received: from SN1NAM02FT043.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::209) by MWHPR02CA0050.outlook.office365.com (2603:10b6:301:60::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.11 via Frontend Transport; Tue, 26 Sep 2017 00:12:54 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) 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.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 SN1NAM02FT043.mail.protection.outlook.com (10.152.72.184) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.35.14 via Frontend Transport; Tue, 26 Sep 2017 00:12:53 +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 1dwdUb-0007BB-74; Mon, 25 Sep 2017 17:12:53 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1dwdUb-0008Vj-2u; Mon, 25 Sep 2017 17:12:53 -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 v8Q0Ch44023049; Mon, 25 Sep 2017 17:12:44 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1dwdUR-0008V4-RD; Mon, 25 Sep 2017 17:12:43 -0700 From: Alistair Francis To: Date: Mon, 25 Sep 2017 17:09:03 -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-23350.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.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(2980300002)(438002)(199003)(189002)(189998001)(36756003)(2950100002)(6916009)(478600001)(16586007)(36386004)(50986999)(316002)(54906003)(77096006)(48376002)(76176999)(50466002)(9786002)(106466001)(2906002)(8936002)(81156014)(8676002)(81166006)(356003)(6666003)(5660300001)(4326008)(33646002)(47776003)(2351001)(63266004)(39060400002)(118296001)(5003940100001)(575784001)(50226002)(305945005)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR02MB1122; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT043; 1:7G0vlT7qwdzc4zfaIB8Sg5dDU3MvjOK9rJGUFyjHrlN79kMM61vXIjIj+8G+CzQXnlH1V2GC8oCmS7mpCN0s9sLtv6s9xatYJGpFOxWobVZJTrT6yIVWzO2p8sG4SmyP MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0da41518-b63b-4f0c-6cce-08d504735549 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BLUPR02MB1122; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1122; 3:GecsHYh2SyrZH1bcdcv3oru08ZNB7Cod7CLaFEFLQ9yb567Xi/OfZmjrY4usf3TyI/8k19mrjTmWP5RrSdnvv7Frx5PnqUp08g5nhZvsttePQqeeJtrzz2pWnaVtfom6IamnfCY3tz+Zivm5xmkl3BotI6JrRa27rqKcd3MOXMNFaIVmGrXaAOEBWm4AjWd/BXJO5g9i76myvfbf7L5SefBPDBu4PF2KTbvjNA5qjGiS7JHkoJUQ8EW+jHOWIq7BrgW4FZ/WsaRUihmJXux8pWG08pKA643c2yRhQr2WjYskI3KAk8xqdNUtHr0cAVYlUvDeZbzswM3mGNSpAAKfH9MF4SQrGsiCHaUKL13xV50=; 25:sOaI7RgNDcE6y7Rjfg1rhM83zTNODLYtJsCHB4HLJX4exXALHC5BJsCEvVnqnGS0pm1I6ScIGI94j3XZcY4Qn1zx/1o/+BBLO6a91WJIZr2u4k7C0Ia0/IxeckvEFzH025lKQSD+ojPk3sQn+pxNMwafpayuHJSjevqhRqrwwWPsSFXPtf0XiaQWuqAT9w/DAI3Wh/fEMLKTYG4y2R8McqxCa6z0376iu1ZFf6bI2vzXAPb/2AHamXbdmZ8SsED6lot04f1tVFa3uKW3HgcBLXH0+SQ9SNPGhXnOgLTryPfRwolVK0qh4OAPj4m07y1Oqc6rWx8ohNy8FBRCWuhZRw== X-MS-TrafficTypeDiagnostic: BLUPR02MB1122: X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1122; 31:UqVFJxMVImD2U458sBzEbgs5aiCq5Obbu8bVwj7ugouZVdi03aU2p4Vdb4gNs6KecGAvsaFDKc/DIJxJQDXLh5339204UqQZ3P0NHccX1V9e1MA8nsKK5/rpYXBuX8F2VUCO3OVBvzOdmDQigoZYhM+6mTo2nXKNYsNB/06OHYABUf0nPHBXDl/covzsJ55rNF/FSWucC+zxvzlHldl8+9+ds8kERbi4r+pHI/k5S8c=; 20:b8gqnaNhZ9Fzt1LTIGPGY0mfVIRNeTaifg5pYEXboN0zx321gs3N7zpcSX5PN/2kEtMlYV/GwDtV+qw5LFOMxBlcxvWlJEi0Sm6VshoAnu7XH17VKHOduZgjaU0da8pg8aFxok0lto77Et1WMm1YVBpXggTZ/PMN05f430X8xQvSIX7EfSvelcd7MQ+2BQpzj/gmzLwowduEA6U+sMIEiWpD2TN+h7a3V0qnM0eZHpJPuAlb/DYCbQ8s+il3vtRF/FV8uVJCBBs0BMqnCvD6yXh4EZvmFsaEJ1drufN96WUtK22Cl4cc7CcCkVI/DrM2JMcB6HTgnD4g0fuht+NKvUsznyj4stoCM0tPAx82YdFB2bs5D5DgAfXfx2Z5vAGbPxuLBKRqvs4UBl7jqL+1OQ/ZXeGMPqJsaTCqj0yd5Io9aPo42vA7Y8Hhr5uI2OKi37yL+9LBqbzkq79y8iJvjcpoaYasHAYh+JVlW7lR968lyc+6P7wH1t3ZbD4oRvvO 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)(100000703101)(100105400095)(10201501046)(93006095)(93004095)(3002001)(6055026)(6041248)(20161123558100)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR02MB1122; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR02MB1122; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1122; 4:lXIFd3Vl7/7EIFaYFWOQ0CW4DXGbn4l2D2ak0dAGmasA/ysZj5joOn26mHa9vyoGZWr5Lzp1ZuiqdND47F552UBJ5z8he/mii+/ERS03KxVSS5Wn1b2I4QU7xAADhfa5VUmsx+I7GVCJtzD1UFFwNAVYyo7c2k25aBIKsdQEkKI/pm+tbwNGPWYBZrwGItkIuu0+HixgRUXyehPjwkwVzmXypJ7MGKY6NGavyW4EVQOPeQhHnlMYyatcOSygI9Y8w1GukdV9nhx6iga3TQE4Z/UVWN/z2lnxR3GY10u42niZejxOGFrn01vrkXM+V+KhWm64VIrmuLeiFI3oGEf09A== X-Forefront-PRVS: 0442E569BC X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR02MB1122; 23:ubUADmbpVgeNJHrJXs9Nuf1h7QxtsCGkCEKUrHPOf?= veVwCtAcyTqTut+IoDPSNTOadfM2g5v8QC8ZuQ/EpyWdJ/o5jAklV66+pjbPcaxUTdrAL9sbiwmF2mdDPyaGK0U7k6D0bQsmdULuTwYlbHxq6lZQCCHVN0mbdkhX92xWPGmj3iPvkXPqNTLN/52/r3UmuG9jqw4L2w8mpJvdfNXA5/XWEjevPUJugPIrO9YU5tYAdmNmGd4ERhnBKiOPiqeg56W272MtfWkVJwhfaKcCqQ8bvqPX4zU4tfJ5jqkW3xbMmBLq4EH8YO2weGOGbhsiuXo/3SUOgE4X++b7m7Ypv3tPL/kofuy35IZd9gSlAH0e+Kpe4MmVJ7zywo03SlaK9hRPd9BXtWxQaEGus6dl7mxmkwlNvBAoQ1/NFGVoxN3wVZ51AFf5K+nViQXV7fsAehGoF0rs/hqetZ9lTzjcEKy2SN8j8xiSRLvY2eUUrjM4o8FZ+asKQBftrNRz7JYHA/jaogvUgfYDRF60BzFJUHRc1KG6ITwboSycySpgg7dwa+5cSAq5sBoZJ0bef6OjLysS59wiZqv/UcuszJX1yDF3aR1OPofOVpi9iJSorQBx8O6PHIk62xXMWENDWUoxf1OhFMv82zc/rF3TFaQ0dLY/yMspz2Km9c+yE3G8neuqQ7/IVdSoSOTmDXFcGP+dDhYO8W1Tnb0Bsl5cDGvSzhLh36afvqQjWAhgleV0YsvRYep7+47OQslbbdB+txNQtB4rEtef6QVDSr0UAKEJvt/7IU3di3ljLszWZIJQuFBbgpPv8VVXnzfa3RArF2mMn3RbErCZkMYWOySihGfAW9mSYEvFoe4UKacFLHUDXUfqVjOEjVjfhu8FH6J+Mxonv7wdvxGgAvRB0hef9XAb8LSt8Dea89V132da6LY5b1dk45FwJVIvKIMNFb/Dd63jt6reSUQJFUeX+bYRgM8M90+mVCmjuu0M3f8TjUwOWdBDkPd+ayP+W52g/7MRujTQ4N5yCF69+yc002KQ2L1zwTWjeJs+npF/jYo1m5NgH8= X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1122; 6:XgA28IuBUeXUXMch/0FlmYpd2XXUc8+7BeWd/60BRHTTpUPxNwoa2hFp5MmDOQvFHB0QvUN7hLcUyYZKCpx9OAVscVlgJHmfiONNh9IC9tD9QQ31riJMNvmW9KQ+1o5Ye0k+XU6cAUeyHlIxRyI54omTNRLcilcrquLYN03Q3GZn3zg8VWPzGLk9WsFy5nAl/0U2BBN1WPhBYWJcykxryMVtiD2PksHDHQUHoEE1IUcMZR9BbH4mFZumbN1H0hkiNeQJiyD9yZsNFlyoBoPv26hpzzYbaqtOjZuR+zXvyhOh5jJIC0yU44waEYh+L+Py0Ni+tLMrbQU0YESS+xQ5aA==; 5:rkUcS+kb9AaxHsf7Vd2LmKvU/TyX2PtbBGsUB1UdXrN4mLOChPDvDhPH5nxEdEGPGIwexN2U2reGQljXjp3kBjMKg0t9Fr9I3+kCsay5ShlkKeIh3vhWaaakIvm2j2zJvzL4PFx8Tb/gnK6O0QpQnA==; 24:awn7dVoFAQKvZpPc6EpQvSgIygmfYf62qo1rZ2d2cLjKJ4qzoOoBBLNekqcd8bXDlSRFf0ieDPbvFIb+UDd3su6RI2tI5/YMQjCfQEnvBvk=; 7:g1ftVPTr3BNrStv78YKeO20EVMw5+rqefUo+MAE+xjwaQKSid/6p9tgQJu+c/H031Cm08JrohpiSC48gpY1ERFzXmxP1hyZX1IlgEzTq5GVG8rsL4LcOp3Yxtr5xymullyp4Xoq4fOkD8hcbqLkc6tytPYukDCVPoyuKxNt0cH6/dIWkshBBeVp2C04H09KSgEdwzvB3Qs2AunFlu/YNdWRcYJl1wy/+vGjatOyNeHk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2017 00:12:53.7043 (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.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR02MB1122 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.51 Subject: [Qemu-devel] [PATCH v1 6/8] 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 | 8 ++++---- 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, 48 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 03cefdf470..06784ec7f0 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -423,7 +423,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 5bd87c265a..99477ea6e6 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 { @@ -2210,12 +2210,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) { @@ -2239,7 +2239,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..5c6fafe55d 100644 --- a/ui/shader.c +++ b/ui/shader.c @@ -85,9 +85,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 +110,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 0b5dbc62e4..2bad9ab971 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