From nobody Mon Feb 9 19:37:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@gnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506732798275987.6201664557374; Fri, 29 Sep 2017 17:53:18 -0700 (PDT) Received: from localhost ([::1]:37652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dy61t-0006eX-FC for importer@patchew.org; Fri, 29 Sep 2017 20:53:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dy5Wj-0005Jc-Mn for qemu-devel@nongnu.org; Fri, 29 Sep 2017 20:21:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dy5Wg-0006fH-Sx for qemu-devel@nongnu.org; Fri, 29 Sep 2017 20:21:05 -0400 Received: from mail-bl2nam02on0048.outbound.protection.outlook.com ([104.47.38.48]:33416 helo=NAM02-BL2-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 1dy5Wg-0006eP-KM for qemu-devel@nongnu.org; Fri, 29 Sep 2017 20:21:02 -0400 Received: from MWHPR0201CA0073.namprd02.prod.outlook.com (10.167.161.14) by CY4PR02MB2694.namprd02.prod.outlook.com (10.175.59.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sat, 30 Sep 2017 00:21:00 +0000 Received: from SN1NAM02FT051.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::204) by MWHPR0201CA0073.outlook.office365.com (2603:10b6:301:75::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Sat, 30 Sep 2017 00:21:00 +0000 Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT051.mail.protection.outlook.com (10.152.73.103) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.56.11 via Frontend Transport; Sat, 30 Sep 2017 00:20:59 +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 1dy5Wc-00084O-Uu; Fri, 29 Sep 2017 17:20:58 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1dy5Wc-0007Z3-Rt; Fri, 29 Sep 2017 17:20:58 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v8U0Kohi001080; Fri, 29 Sep 2017 17:20:50 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1dy5WU-0007Xh-IU; Fri, 29 Sep 2017 17:20:50 -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=6uYMhJz0XALvSN4lLpnvtTvrngZ7OrSJlN3IGSuhIbQ=; b=VPEZ0JDlG+2UjV3aE8zYyJS2FKrfD63t6cvLvlIHpmZo3pvG2m/X5Z6JN5JwNQ7j6rN9F/na+aErF9k/LQqbfTGEGCr7hKAbnfRthcONdP02CtTW/q5mpAkJld0Y+ylD4Y5GeM7P2GtVSpae7xjs6+vZ3PGaEMXASQTAyvKh6/g= Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@gnu.org; helo=lists.gnu.org; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; From: Alistair Francis To: Date: Fri, 29 Sep 2017 17:17:03 -0700 Message-ID: <06e443b5be5198646e9f76b80df198e954543daf.1506730372.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23358.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(2980300002)(438002)(199003)(189002)(76176999)(305945005)(16586007)(5660300001)(316002)(106466001)(189998001)(77096006)(63266004)(478600001)(33646002)(2351001)(5003940100001)(6306002)(551934003)(4326008)(9786002)(47776003)(54906003)(356003)(50226002)(39060400002)(36756003)(118296001)(2950100002)(48376002)(2906002)(50986999)(6916009)(8676002)(575784001)(81166006)(50466002)(36386004)(8936002)(6666003)(81156014)(106002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR02MB2694; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT051; 1:e48Ojb2ZcuW9LPK2DIt5Ie4NACI2942Yz/1ecwwrNCZAiOafdOjZdGG3Niak1KWC8pMSpsDp650JxwI4ek6Q6CwGPUPxsBpAd+CvGJv4xkP8ZTMLNpUtBQ6+gUanYqsx MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b64cf4ba-b560-4c84-25a6-08d507992082 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY4PR02MB2694; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB2694; 3:uTvq15MFfOtquMCNA39hmWsmes5X46DB37MZ/Nu8r+QhsqsVG+YFmIVjEyEQmInSx/KsLzdtitC/dmRjvFocG0jbneal78SfHxZNR4DL6dvNABKQxSNLd/xqgtKMho8wn9ETvNk0lRezG+Q2L7xYFa4XhlH3xyneoGnb2oCcQE6iaCZv83ml662sjxi3CMpgDALoyhknPlbsCdAG4HsxAXoVakon57addUJzc8JsIg1JUHkTb2983FxZh/GjlWn2sEMnDEZxWFBJpK6Hq7kf2MKhcKrcHyYAil83eqFX44qGUCjMXwdiUKqbsx/v5XdwdTMIom/bRCnWy8lohIbcFAYx6ozYm+JTjhSELf6wOSI=; 25:4fj5WUFnQkNCvgwQTADVf1bkFwcwPd47mrqC0iWDTHtwZj3wNogh0TLSNanCNvczuraIC4gFF+o1Zh6Q95cLZkSBoLxCW2YJDHEMRy403Qp/ltY3bQlwTIocuwIKtoy0Tgyq7YeqMo3LEEnbUGUa3kkM6/mAkLxmT89sRGFpYZCgosn7WATn23mtUa8V3QV7uNXPt6ThmH0j4q0dB79WjXxWhSpg9Xt2IHl45Y1qRq7IdnimIzmUU5xBTfImscQJqOBOU1z4uX3EMkJtlcRbqnSr0g6Ssr6XUWXoJBZe7F4+mF4sBVKXaAUhCbDR4wqz0LDy3c48Zxvu3z0QFbtlgg== X-MS-TrafficTypeDiagnostic: CY4PR02MB2694: X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB2694; 31:b1Zw4p1H6gRRLi8iXdmMudIozMpkF2nvFBeN2JWZsmlbHGEMS+ZbGSqeauJiUQ6gke1uRQOV6LDhpvtaPrypvoaBaSUhrBiBzCqWOS65ZSb1SvcwNPBvzb25gZahErq2Cxvfdb7fQZYzoEfS/MB3UfwxUEPc2Y/AIc9k7G6EA9Z1o6NOu7xpZ2/H0GAugSVbTSWcaRQQEuKBIWwXjX9eyfCnD/QLXYHw6QqlydHRG4o=; 20:ZJSygLuL2ePfemKI9Tfqzf9KZLcRtxmogylH99Lf+dZxtoh8dPXRATsMor2TVlyTr7ZjaCQDU2DVRfYPgMr8YFgandTfwyJ+rqkQ6oN6Gt4Vvn5IAZOj2TP67LIVx6DzfQFl7x8tzhkn3dDo57RrdJcBHEZJgFJ7MK858Mpyh+cf3HX07zVrglY179CUQylolNQesFzmb5IDW3DbitfsDmrCAXaF3A4Uq3keA9f/hy63UsmC10cqdpwnB92jmL0wfeYi48nKm6rDGQgWwMnoAfgdH+hf7gXNCSf9LdG/5I2lf+U9FOqbzpRzHG1DMTKvLBweL0fprv34PqLzgamGHwHOwC8pQSqtIK+/pcXoQMngimWjbhJEbtySpUpXIDh//oxK+JQSnd0EnLj9Mgaz5P5UCYNr5TD376LOfIsrpTbajTzkVedQdt0C6IYnY2kT+8iVha+5FuInWoctU/0mops3rCVpStbLrKK5xlApJHxLFmUgp0y+P+Lw4Zu2Sana X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(72170088055959)(22074186197030)(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)(93006095)(93004095)(3002001)(10201501046)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR02MB2694; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR02MB2694; X-Microsoft-Exchange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GrNYHDUBDHGOEsRtXD4aXZ+Ti4LOyOmyCyPGTQ2Pa0HU3iqUNHhNCyw5iMfUwvbJvs/T77xjI4F7Mxz8wxDQy/NtjgM6vDe/FcMXkiTwF9uVmuJlGVBOq/LnTKfKYfrH/6UilsHozritN3Bji/JLE5FQsbOcWcOIEkF6Lb77V5r7an+Mpa/wrbJQBobGg==; 5:CkBaCdQEHMRBnvxYPLWtqU4tK6EvOn6UTfABADjwj7LglP8wbJ7qj7Iy9hSzVjAuBGFKW8BjSMuW66Nnjq+Vd+arJAyF2dqHq0hEFGcCDtsdprgbG5OfmnAByd4AfjjYoaL0jzBuYHH6JO8voWfH9lyszXJv8eJ8IiAk/ZgottM=; 24:Iz+ybVoRaQ3tas+XM7y2NMGSJ/Nvv/UWfY45NS0R/ItKAiht/ChcHR9wFMCbf/2LxQztHWcV6VvEKdqUpGVUlqer8FyvrzzvSXi3S2yBndM=; 7:hMx4/l/FI9gjXeoUUwb7noJlqtj7tTuDCFoMWywWOxo7S80h3TzvziPEmlXfoEwUL1F80cqjLueMcOVqXMGckjHpUbdI2w9UXK8Ds7bGhODQcCxyjGR8RfESURI7IWJoh26I6cJTpXMh1E8hDtzh3quv1sLvJGtJVNPohe4ZWJO8o1+yx2Mw7qIy22gxxHq5DjEW118Vg9cKUixmzIBTgA0b142igyy7LaBjtl60ZAY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2017 00:20:59.6302 (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: CY4PR02MB2694 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.48 Subject: [Qemu-devel] [PATCH v2 40/47] hw/usb: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair23@gmail.com, Gerd Hoffmann , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+importer=patchew.org@gnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Gerd Hoffmann --- V2: - Split hw patch into individual directories hw/usb/core.c | 15 ++++++++------- hw/usb/desc.c | 4 ++-- hw/usb/dev-audio.c | 29 +++++++++++++++-------------- hw/usb/dev-bluetooth.c | 4 ++-- hw/usb/dev-mtp.c | 9 +++++---- hw/usb/dev-network.c | 20 ++++++++++---------- hw/usb/hcd-ehci.c | 32 ++++++++++++++++---------------- hw/usb/hcd-musb.c | 4 ++-- hw/usb/hcd-xhci.c | 3 ++- hw/usb/host-legacy.c | 2 +- 10 files changed, 63 insertions(+), 59 deletions(-) diff --git a/hw/usb/core.c b/hw/usb/core.c index 241ae66b15..9ffdef055c 100644 --- a/hw/usb/core.c +++ b/hw/usb/core.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "hw/usb.h" #include "qemu/iov.h" @@ -599,7 +600,7 @@ void usb_packet_copy(USBPacket *p, void *ptr, size_t by= tes) iov_from_buf(iov->iov, iov->niov, p->actual_length, ptr, bytes); break; default: - fprintf(stderr, "%s: invalid pid: %x\n", __func__, p->pid); + error_report("%s: invalid pid: %x", __func__, p->pid); abort(); } p->actual_length +=3D bytes; @@ -681,7 +682,7 @@ void usb_ep_dump(USBDevice *dev) }; int ifnum, ep, first; =20 - fprintf(stderr, "Device \"%s\", config %d\n", + error_report("Device \"%s\", config %d", dev->product_desc, dev->configuration); for (ifnum =3D 0; ifnum < 16; ifnum++) { first =3D 1; @@ -690,10 +691,10 @@ void usb_ep_dump(USBDevice *dev) dev->ep_in[ep].ifnum =3D=3D ifnum) { if (first) { first =3D 0; - fprintf(stderr, " Interface %d, alternative %d\n", + error_report(" Interface %d, alternative %d", ifnum, dev->altsetting[ifnum]); } - fprintf(stderr, " Endpoint %d, IN, %s, %d max\n", ep, + error_report(" Endpoint %d, IN, %s, %d max", ep, tname[dev->ep_in[ep].type], dev->ep_in[ep].max_packet_size); } @@ -701,16 +702,16 @@ void usb_ep_dump(USBDevice *dev) dev->ep_out[ep].ifnum =3D=3D ifnum) { if (first) { first =3D 0; - fprintf(stderr, " Interface %d, alternative %d\n", + error_report(" Interface %d, alternative %d", ifnum, dev->altsetting[ifnum]); } - fprintf(stderr, " Endpoint %d, OUT, %s, %d max\n", ep, + error_report(" Endpoint %d, OUT, %s, %d max", ep, tname[dev->ep_out[ep].type], dev->ep_out[ep].max_packet_size); } } } - fprintf(stderr, "--\n"); + error_report("--"); } =20 struct USBEndpoint *usb_ep_get(USBDevice *dev, int pid, int ep) diff --git a/hw/usb/desc.c b/hw/usb/desc.c index 85c15addc5..afae910f8e 100644 --- a/hw/usb/desc.c +++ b/hw/usb/desc.c @@ -1,5 +1,5 @@ #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "hw/usb.h" #include "hw/usb/desc.h" #include "trace.h" @@ -688,7 +688,7 @@ int usb_desc_get_descriptor(USBDevice *dev, USBPacket *= p, break; =20 default: - fprintf(stderr, "%s: %d unknown type %d (len %zd)\n", __func__, + error_report("%s: %d unknown type %d (len %zd)", __func__, dev->addr, type, len); break; } diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index 343345235c..43fc20469a 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -30,6 +30,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "hw/usb.h" #include "hw/usb/desc.h" @@ -398,7 +399,7 @@ static int usb_audio_set_output_altset(USBAudioState *s= , int altset) } =20 if (s->debug) { - fprintf(stderr, "usb-audio: set interface %d\n", altset); + error_report("usb-audio: set interface %d", altset); } s->out.altset =3D altset; return 0; @@ -478,7 +479,7 @@ static int usb_audio_set_control(USBAudioState *s, uint= 8_t attrib, uint16_t vol =3D data[0] + (data[1] << 8); =20 if (s->debug) { - fprintf(stderr, "usb-audio: vol %04x\n", (uint16_t)vol); + error_report("usb-audio: vol %04x", (uint16_t)vol); } =20 vol -=3D 0x8000; @@ -496,7 +497,7 @@ static int usb_audio_set_control(USBAudioState *s, uint= 8_t attrib, =20 if (set_vol) { if (s->debug) { - fprintf(stderr, "usb-audio: mute %d, lvol %3d, rvol %3d\n", + error_report("usb-audio: mute %d, lvol %3d, rvol %3d", s->out.mute, s->out.vol[0], s->out.vol[1]); } AUD_set_volume_out(s->out.voice, s->out.mute, @@ -514,8 +515,8 @@ static void usb_audio_handle_control(USBDevice *dev, US= BPacket *p, int ret =3D 0; =20 if (s->debug) { - fprintf(stderr, "usb-audio: control transaction: " - "request 0x%04x value 0x%04x index 0x%04x length 0x%04x\n", + error_report("usb-audio: control transaction: " + "request 0x%04x value 0x%04x index 0x%04x length 0x%04x", request, value, index, length); } =20 @@ -533,7 +534,7 @@ static void usb_audio_handle_control(USBDevice *dev, US= BPacket *p, length, data); if (ret < 0) { if (s->debug) { - fprintf(stderr, "usb-audio: fail: get control\n"); + error_report("usb-audio: fail: get control"); } goto fail; } @@ -548,7 +549,7 @@ static void usb_audio_handle_control(USBDevice *dev, US= BPacket *p, length, data); if (ret < 0) { if (s->debug) { - fprintf(stderr, "usb-audio: fail: set control\n"); + error_report("usb-audio: fail: set control"); } goto fail; } @@ -557,8 +558,8 @@ static void usb_audio_handle_control(USBDevice *dev, US= BPacket *p, default: fail: if (s->debug) { - fprintf(stderr, "usb-audio: failed control transaction: " - "request 0x%04x value 0x%04x index 0x%04x length 0x%04= x\n", + error_report("usb-audio: failed control transaction: " + "request 0x%04x value 0x%04x index 0x%04x length 0x%04= x", request, value, index, length); } p->status =3D USB_RET_STALL; @@ -581,7 +582,7 @@ static void usb_audio_handle_reset(USBDevice *dev) USBAudioState *s =3D USB_AUDIO(dev); =20 if (s->debug) { - fprintf(stderr, "usb-audio: reset\n"); + error_report("usb-audio: reset"); } usb_audio_set_output_altset(s, ALTSET_OFF); } @@ -595,7 +596,7 @@ static void usb_audio_handle_dataout(USBAudioState *s, = USBPacket *p) =20 streambuf_put(&s->out.buf, p); if (p->actual_length < p->iov.size && s->debug > 1) { - fprintf(stderr, "usb-audio: output overrun (%zd bytes)\n", + error_report("usb-audio: output overrun (%zd bytes)", p->iov.size - p->actual_length); } } @@ -611,8 +612,8 @@ static void usb_audio_handle_data(USBDevice *dev, USBPa= cket *p) =20 p->status =3D USB_RET_STALL; if (s->debug) { - fprintf(stderr, "usb-audio: failed data transaction: " - "pid 0x%x ep 0x%x len 0x%zx\n", + error_report("usb-audio: failed data transaction: " + "pid 0x%x ep 0x%x len 0x%zx", p->pid, p->ep->nr, p->iov.size); } } @@ -622,7 +623,7 @@ static void usb_audio_unrealize(USBDevice *dev, Error *= *errp) USBAudioState *s =3D USB_AUDIO(dev); =20 if (s->debug) { - fprintf(stderr, "usb-audio: destroy\n"); + error_report("usb-audio: destroy"); } =20 usb_audio_set_output_altset(s, ALTSET_OFF); diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c index 0bbceaea0b..dfef258dca 100644 --- a/hw/usb/dev-bluetooth.c +++ b/hw/usb/dev-bluetooth.c @@ -274,13 +274,13 @@ static void usb_bt_fifo_enqueue(struct usb_hci_in_fif= o_s *fifo, if (off <=3D DFIFO_LEN_MASK) { if (off + len > DFIFO_LEN_MASK + 1 && (fifo->dsize =3D off + len) > (DFIFO_LEN_MASK + 1)= * 2) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); + error_report("%s: can't alloc %i bytes", __func__, len); exit(-1); } buf =3D fifo->data + off; } else { if (fifo->dlen > fifo->dsize) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); + error_report("%s: can't alloc %i bytes", __func__, len); exit(-1); } buf =3D fifo->data + off - fifo->dsize; diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 94c2e94f10..7e1782b8fc 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -10,6 +10,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include #include @@ -546,7 +547,7 @@ static void inotify_watchfn(void *arg) break; =20 default: - fprintf(stderr, "usb-mtp: failed to parse inotify event\n"= ); + error_report("usb-mtp: failed to parse inotify event"); continue; } =20 @@ -617,7 +618,7 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObje= ct *o) #ifdef CONFIG_INOTIFY1 int watchfd =3D usb_mtp_add_watch(s->inotifyfd, o->path); if (watchfd =3D=3D -1) { - fprintf(stderr, "usb-mtp: failed to add watch for %s\n", o->path); + error_report("usb-mtp: failed to add watch for %s", o->path); } else { trace_usb_mtp_inotify_event(s->dev.addr, o->path, 0, "Watch Added"); @@ -1144,7 +1145,7 @@ static void usb_mtp_command(MTPState *s, MTPControl *= c) usb_mtp_object_alloc(s, s->next_handle++, NULL, s->root); #ifdef CONFIG_INOTIFY1 if (usb_mtp_inotify_init(s)) { - fprintf(stderr, "usb-mtp: file monitoring init failed\n"); + error_report("usb-mtp: file monitoring init failed"); } #endif break; @@ -1348,7 +1349,7 @@ static void usb_mtp_handle_control(USBDevice *dev, US= BPacket *p, static void usb_mtp_cancel_packet(USBDevice *dev, USBPacket *p) { /* we don't use async packets, so this should never be called */ - fprintf(stderr, "%s\n", __func__); + error_report("%s", __func__); } =20 static void usb_mtp_handle_data(USBDevice *dev, USBPacket *p) diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index 85fc81bf43..9dd4af5e34 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -815,7 +815,7 @@ static int ndis_query(USBNetState *s, uint32_t oid, return sizeof(le32); =20 default: - fprintf(stderr, "usbnet: unknown OID 0x%08x\n", oid); + error_report("usbnet: unknown OID 0x%08x", oid); return 0; } return -1; @@ -1084,9 +1084,9 @@ static void usb_net_handle_control(USBDevice *dev, US= BPacket *p, for (i =3D 0; i < length; i++) { if (!(i & 15)) fprintf(stderr, "\n%04x:", i); - fprintf(stderr, " %02x", data[i]); + error_report(" %02x", data[i]); } - fprintf(stderr, "\n\n"); + fprintf(stderr, "\n"); } #endif ret =3D rndis_parse(s, data, length); @@ -1111,17 +1111,17 @@ static void usb_net_handle_control(USBDevice *dev, = USBPacket *p, for (i =3D 0; i < p->actual_length; i++) { if (!(i & 15)) fprintf(stderr, "\n%04x:", i); - fprintf(stderr, " %02x", data[i]); + error_report(" %02x", data[i]); } - fprintf(stderr, "\n\n"); + fprintf(stderr, "\n"); } #endif break; =20 default: fail: - fprintf(stderr, "usbnet: failed control transaction: " - "request 0x%x value 0x%x index 0x%x length 0x%x\n", + error_report("usbnet: failed control transaction: " + "request 0x%x value 0x%x index 0x%x length 0x%x", request, value, index, length); p->status =3D USB_RET_STALL; break; @@ -1190,7 +1190,7 @@ static void usb_net_handle_dataout(USBNetState *s, US= BPacket *p) uint32_t len; =20 #ifdef TRAFFIC_DEBUG - fprintf(stderr, "usbnet: data out len %zu\n", p->iov.size); + error_report("usbnet: data out len %zu", p->iov.size); iov_hexdump(p->iov.iov, p->iov.niov, stderr, "usbnet", p->iov.size); #endif =20 @@ -1260,8 +1260,8 @@ static void usb_net_handle_data(USBDevice *dev, USBPa= cket *p) } =20 if (p->status =3D=3D USB_RET_STALL) { - fprintf(stderr, "usbnet: failed data transaction: " - "pid 0x%x ep 0x%x len 0x%zx\n", + error_report("usbnet: failed data transaction: " + "pid 0x%x ep 0x%x len 0x%zx", p->pid, p->ep->nr, p->iov.size); } } diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 0134232627..e405b882fb 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -419,7 +419,7 @@ static int ehci_get_pid(EHCIqtd *qtd) case 2: return USB_TOKEN_SETUP; default: - fprintf(stderr, "bad token\n"); + error_report("bad token"); return 0; } } @@ -1033,7 +1033,7 @@ static void ehci_opreg_write(void *ptr, hwaddr addr, =20 /* not supporting dynamic frame list size at the moment */ if ((val & USBCMD_FLS) && !(s->usbcmd & USBCMD_FLS)) { - fprintf(stderr, "attempt to set frame list size -- value %d\n", + error_report("attempt to set frame list size -- value %d", (int)val & USBCMD_FLS); val &=3D ~USBCMD_FLS; } @@ -1190,7 +1190,7 @@ static int ehci_init_transfer(EHCIPacket *p) =20 while (bytes > 0) { if (cpage > 4) { - fprintf(stderr, "cpage out of range (%d)\n", cpage); + error_report("cpage out of range (%d)", cpage); qemu_sglist_destroy(&p->sgl); return -1; } @@ -1296,7 +1296,7 @@ static void ehci_execute_complete(EHCIQueue *q) break; default: /* should not be triggerable */ - fprintf(stderr, "USB invalid response %d\n", p->packet.status); + error_report("USB invalid response %d", p->packet.status); g_assert_not_reached(); break; } @@ -1345,7 +1345,7 @@ static int ehci_execute(EHCIPacket *p, const char *ac= tion) p->async =3D=3D EHCI_ASYNC_INITIALIZED); =20 if (!(p->qtd.token & QTD_TOKEN_ACTIVE)) { - fprintf(stderr, "Attempting to execute inactive qtd\n"); + error_report("Attempting to execute inactive qtd"); return -1; } =20 @@ -1383,7 +1383,7 @@ static int ehci_execute(EHCIPacket *p, const char *ac= tion) p->packet.actual_length); =20 if (p->packet.actual_length > BUFF_SIZE) { - fprintf(stderr, "ret from usb_handle_packet > BUFF_SIZE\n"); + error_report("ret from usb_handle_packet > BUFF_SIZE"); return -1; } =20 @@ -1461,7 +1461,7 @@ static int ehci_process_itd(EHCIState *ehci, case USB_RET_SUCCESS: break; default: - fprintf(stderr, "Unexpected iso usb result: %d\n", + error_report("Unexpected iso usb result: %d", ehci->ipacket.status); /* Fall through */ case USB_RET_IOERROR: @@ -1564,7 +1564,7 @@ static int ehci_state_fetchentry(EHCIState *ehci, int= async) =20 /* section 4.8, only QH in async schedule */ if (async && (NLPTR_TYPE_GET(entry) !=3D NLPTR_TYPE_QH)) { - fprintf(stderr, "non queue head request in async schedule\n"); + error_report("non queue head request in async schedule"); return -1; } =20 @@ -1586,8 +1586,8 @@ static int ehci_state_fetchentry(EHCIState *ehci, int= async) =20 default: /* TODO: handle FSTN type */ - fprintf(stderr, "FETCHENTRY: entry at %X is of type %d " - "which is not supported yet\n", entry, NLPTR_TYPE_GET(entr= y)); + error_report("FETCHENTRY: entry at %X is of type %d " + "which is not supported yet", entry, NLPTR_TYPE_GET(entry)= ); return -1; } =20 @@ -2086,7 +2086,7 @@ static void ehci_advance_state(EHCIState *ehci, int a= sync) break; =20 default: - fprintf(stderr, "Bad state!\n"); + error_report("Bad state!"); again =3D -1; g_assert_not_reached(); break; @@ -2094,7 +2094,7 @@ static void ehci_advance_state(EHCIState *ehci, int a= sync) =20 if (again < 0 || itd_count > 16) { /* TODO: notify guest (raise HSE irq?) */ - fprintf(stderr, "processing error - resetting ehci HC\n"); + error_report("processing error - resetting ehci HC"); ehci_reset(ehci); again =3D 0; } @@ -2151,8 +2151,8 @@ static void ehci_advance_async_state(EHCIState *ehci) =20 default: /* this should only be due to a developer mistake */ - fprintf(stderr, "ehci: Bad asynchronous state %d. " - "Resetting to active\n", ehci->astate); + error_report("ehci: Bad asynchronous state %d. " + "Resetting to active", ehci->astate); g_assert_not_reached(); } } @@ -2201,8 +2201,8 @@ static void ehci_advance_periodic_state(EHCIState *eh= ci) =20 default: /* this should only be due to a developer mistake */ - fprintf(stderr, "ehci: Bad periodic state %d. " - "Resetting to active\n", ehci->pstate); + error_report("ehci: Bad periodic state %d. " + "Resetting to active", ehci->pstate); g_assert_not_reached(); } } diff --git a/hw/usb/hcd-musb.c b/hw/usb/hcd-musb.c index d70a91a58c..4729926124 100644 --- a/hw/usb/hcd-musb.c +++ b/hw/usb/hcd-musb.c @@ -253,8 +253,8 @@ /* #define MUSB_DEBUG */ =20 #ifdef MUSB_DEBUG -#define TRACE(fmt, ...) fprintf(stderr, "%s@%d: " fmt "\n", __func__, \ - __LINE__, ##__VA_ARGS__) +#define TRACE(fmt, ...) error_report("%s@%d: " fmt "", __func__, \ + __LINE__, ##__VA_ARGS__) #else #define TRACE(...) #endif diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index d75c085d94..6cc1be09a2 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -19,6 +19,7 @@ * License along with this library; if not, see . */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "qemu/timer.h" #include "qemu/queue.h" @@ -39,7 +40,7 @@ #else #define DPRINTF(...) do {} while (0) #endif -#define FIXME(_msg) do { fprintf(stderr, "FIXME %s:%d %s\n", \ +#define FIXME(_msg) do { error_report("FIXME %s:%d %s", \ __func__, __LINE__, _msg); abort(); } whi= le (0) =20 #define TRB_LINK_LIMIT 32 diff --git a/hw/usb/host-legacy.c b/hw/usb/host-legacy.c index 3b57e21b52..f0c81e5309 100644 --- a/hw/usb/host-legacy.c +++ b/hw/usb/host-legacy.c @@ -86,7 +86,7 @@ static int parse_filter(const char *spec, struct USBAutoF= ilter *f) } =20 if (i < DEV) { - fprintf(stderr, "husb: invalid auto filter spec %s\n", spec); + error_report("husb: invalid auto filter spec %s", spec); return -1; } =20 --=20 2.11.0