From patchwork Wed Nov 8 22:58:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 836074 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="29kjsHjq"; 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 3yXMw41Sfhz9s4q for ; Thu, 9 Nov 2017 10:29:56 +1100 (AEDT) Received: from localhost ([::1]:34444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCZn8-0005Dt-7t for incoming@patchwork.ozlabs.org; Wed, 08 Nov 2017 18:29:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCZMi-0000dh-Ey for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:02:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCZMf-0003ez-Az for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:02:36 -0500 Received: from mail-sn1nam02on0075.outbound.protection.outlook.com ([104.47.36.75]:43472 helo=NAM02-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 1eCZMf-0003eC-2I for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:02:33 -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=3D9f0Ji5BrzqsPCESXSQjjaH1NICRmQLtYa30yJWLOc=; b=29kjsHjqSh6w8nGS9VB0EKNTaywbJdsvYMsZoCIeURSspLgjojUP8ohZ2x8ArgMIOK/x1hdfFfGnVYKZI4yiKXKuRAaMKMCGflikn/t86zc+1YQcN1DddFjJRGuz50j8weBvopVp0kIMtuTedRZ79AOotYlXg9n6pflU/moryQw= Received: from MWHPR02CA0018.namprd02.prod.outlook.com (10.168.209.156) by CY1PR02MB1336.namprd02.prod.outlook.com (10.161.170.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Wed, 8 Nov 2017 23:02:29 +0000 Received: from CY1NAM02FT054.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::201) by MWHPR02CA0018.outlook.office365.com (2603:10b6:300:4b::28) 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:02:29 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; 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 CY1NAM02FT054.mail.protection.outlook.com (10.152.74.100) 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:02:28 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:36212 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1eCZMZ-0003yb-Li; Wed, 08 Nov 2017 15:02:27 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1eCZMZ-00035r-IM; Wed, 08 Nov 2017 15:02:27 -0800 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id vA8N2PDx010352; Wed, 8 Nov 2017 15:02:26 -0800 Received: from [172.19.2.220] (helo=xsjalistai50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1eCZMX-00035b-RH; Wed, 08 Nov 2017 15:02:25 -0800 From: Alistair Francis To: Date: Wed, 8 Nov 2017 14:58:27 -0800 Message-ID: <84c9f4caac39c30ac03f742d9096bb0270c3cae3.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.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(199003)(189002)(50986999)(5003940100001)(8936002)(16586007)(118296001)(63266004)(81156014)(81166006)(54906003)(50226002)(76176999)(4326008)(478600001)(316002)(8676002)(6916009)(33646002)(47776003)(77096006)(106466001)(356003)(106002)(2950100002)(48376002)(9786002)(5660300001)(36756003)(305945005)(50466002)(39060400002)(36386004)(189998001)(2906002)(2351001)(107986001)(21314002)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1336; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT054; 1:5T7IVkuTIPBefk2FVvtq/BZBXnnjN7WtgdsqPbl9qZsnI8U8VFgLCL0pS4Z+0w2pPEgc7HkzT5EypWlugc8nP+i65mHHTDaJ8TSvsrGe3ssb1EfIbKsR7P8gzOAVwPuF MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0d6d4b1-814f-49c6-9a63-08d526fcc8fa X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603249); SRVR:CY1PR02MB1336; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1336; 3:RNpbSwGLbZ8W7TTF5S3rUIQCVGYhQol+mAXZVnWJ6kgcY6lBLIfm3nuvOTBJ61LicZuJWu3TaGVXcBVFxR3TeCWF5hicTz/QxbdEGK2LSd1cpW0SPncW0L8GX8/mLRAjWvCfRUCzEjo6yOLrxyNY5c3dRvT1h3AxmYHBo26IjjZo5PgG5rPmw2k+kKHY0VwnZYc/mjfAl1AKn80c96PBDrbxTcuWtkpkR5mNrzM0JA+YSWRXqqmD+7aRvlwSRyje5ochgEQ0tvzvqQsvh4puwvu9KW0U7VJMtUDXd/v40G+pgvCsnOvRNWWOyrSo8hzMoizMsPHfNPaINZMUAazg8FIrosTg8lLuZzHzN/EWEiU=; 25:7Od0MtOhD3LYMGTih0uqjBo3p0VopSKF3V2VkKncLjcH4Ly5Foka/q9UjuKWZe18KQeze4v+iq+QnDvdhTV6NlbdgXf/ELoZNGYkaL4J8x5Q1bFDvPDnCY3apWoR4Gxt4rp/eRoG6ekOiKERHWRkpdAX/Ksu4g7ubmCLPjKTZpLmRSiq07Mz+ovzzS7Tto2PVraZsKOsMmt7lhWPKbstXzZeRxyNec2xDfCBKbGI3hEnpWX/ND7InWFnXgXJhC3Pij6NBuJuCO9CQBVnwku/M3VSVk/RD4aJ0gRJWHqjvhNDd1DCkfHvkpo3XXLtzza64tEwDPcnQ385zAhN/vGi1w== X-MS-TrafficTypeDiagnostic: CY1PR02MB1336: X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1336; 31:EoAUDlsdRRZc20m7IgoPee/SRzZkRrbfGqB+tuWCQrliWbo44dkXaVywci9feVz1VAxYDBogdinM/H/zuRkbwhKIQ6RtOip6N6H4/eI1y53PGWEwNgkA9ODWb84JKpGy4nJOp6Xb2TZVegMs1wVhpkpgyHunodlAb5IosQiIxMMOalYrcaA70vghF+QMP0qhwj3VFbKIl9znjJSelWp8rvMzUlWZz4B2JYV6sJZay3w=; 20:2uxBHQE+qZRudytbXvPpZoAk0U1D4H014yr+2KfZ6SPkAs8DW5enVDzYQDQCZZS2rgRYHwbKLf3utCxyaM0EUHpox3J/EdpyV3VmHfRjcxJxzaekzuzTT3sSFdGENFcACals5Gk2SB4pVPDd8+1V8r2pzYXNslvv0ym7v29VZlypb8A89E6Vy1Lc17NTciFkitr24CBWzeUtayrKzLAsQjv8e6DfZX26slGkA6S/4Ib5nuTLkPxdnww4rbrAGhzbwneywkGyMQ7YVIWfk4tHbjqfkcwWPaZLpQukHnjNdehQ8kqR0F4krX/Rs8BSSXHD3Mra5I9Xw/32TSwHm4PSn8FoSNiggcMuwmJcr6kNj3Bwj8fBercRN1axs1QktfYzFiVhWXac5wwDvUxV4sy7jBpnNV44t1d1EuF7dk9AsXSc4tIEQgYr1upxkeIWs/4EAjleOPRGKUM57q4NDZY5QuzksN1xJ+WqHAPJdNxhwmAFpz8qcCWvKCo3hcPtjFpI 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)(3231021)(93006095)(93004095)(3002001)(6055026)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR02MB1336; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR02MB1336; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1336; 4:QHpWcpgp6Lm87rNzkjS8iWgknzi+FR1pe02h4paa/RHUvl2gNcTNTzOVlG7FI1k2myIQ5LCYBy0H0Pj9XzeGBEbWlY5K7UJWUKVhcoytJfWgcuMOwYmdK8P+oRfekvSz5p9+VeNB7wLtOSbtmxWG6kWA2+XOpaDsaMOHRYQW9ehjTNrMgx8WTLtlDTwfiG5sv8tYhfzyjgEgBUlaXyEE8IN+2Qyl8h5qP6X3dx0S5L1KIRzBzyI5eqH5pUUcq3lc14fpFOS50t0tbRRgPcn/YDXsXm3f5rEjcmWZN0fFH9NYq5vYzj9uD10yJu/t1BO+6t++OJdbmUHLPxUCAkgJtg== X-Forefront-PRVS: 0485417665 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR02MB1336; 23:WX3nmBjsafRvnBlW07RrHG9Fe9qp/8cE9KGqJEd4m?= s5Unjrghs96hwLQE12EbH6HgmO96Ux0nhYpe3xa4csJt87TDuTwWzEk0vFW0yyk6pNYZIL9+sRCu/xkRBsYWlEaG4bipQmV5yp4HCKzM36JUTguMVj98Tvy/JPNCBeul23efNhs5sbJEmNN7gVv07TiNqGbqWc0zmgqaFaeEheAsOjbjnB1MJ9EHy7omjPKyEEdsF/NoObxbcDMZ78/1Pd/uvgiOcWy0e+l1UxA0gyEJ150oTtBrvN4TPv0VJ5XS5TkfZWjHD3aTF5PSco2HLVhGAIN47mR9zfcx8+ZRcda3h8UMk5xVe5OXkvHkdo39HzteKpUJ2cM9Uf1h8ePYg0/J6t5Vj79KMzstC9FRIUTfvXgQc3p6f8dAXeOjbP+zfBRuQrUQZcnCKo+WqanOF2DsYNgqqp30tblosyhmQG5NO09IIQ3ENpRhLhUr1UoP83XxCEJrsdGLdpcTUGP9yYcluGOaLF+gEAQ2PF64hqlUujF8Z5C8zPPHEmktWK+Ucg0lS5ZtiggkRDlUJGuFF8pEvKhBYm+RT1InUeiW+PhN9fjVyhKX21hkXGPUN0hVJiDQ8McyPe908smMqvnPJq9+TPMXEwkxrX0bkIytxfERdTGrp3H1Uu1ljJHK2W0STTGl/owz1x++5D2BvBLRU5ljvGgl9oNR9l61FIUuUnho3r35FOx9Ktsr+c+pnvf2M+c8Z1ql3ZXu743mrEyFSB//TTQV+wqS+TkgsFTzTNfV67a6ktIdAAJVz/9u3u8eNN65pDzFCVEIPOxlpV4IkKOjkqbRDhBz1Vr9In4og2K+E+d8vGA2tT4qTUsKKqXEzH7ReZlEZregKvP7iQ0yxIA3ijGnQcCpWRn9RicncZ+4PYMH9mw4kZyaGcFXzZ/9Mbn9A5qaCie92p4NdOqQPPhqa2YtfcghCm5M+iF1MOCaSAQcSiW2+B2wOex9z1bhpaW1jCeKe2nCl2KUSUcRTrr7io6m6p7wZkCxCpvmHkWVA3+t24akiPteX+4aVVAS0XeBNfsszur2oHW/l+qVsm8 X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1336; 6:O8sfaF0PJomhJIFv2MAAmmdy0a0o44Syyp51Fix3/EWirxLxCbRkZHcaA8itHZ/GheylrAs/6jMzs07oaneKsGF71S7g2sFC0IGjvFD4L7oZXlOg3J9EEMNSAUbwwpgWRf1lBNrTTQdwX5B1cUPtaWskxtQ6TBH8CTO1o9BYm4sx9kImcahLdxmfBdAfTFD7wEfFD0chApJblSsVBzdO5rAy7JKxSpb1CrIBYKvaUmJ/u6yTHYXr/rqGD/iRHnwpRf2DBjTLv1dAJvvsxhKry8TkQbHddlDWcUWfT9LV38WSdp0HCxAzU5e0iXZlmlObGCKIIPbY8eOLhgiIUsMLY3en6VojKqd65HQYl30qoA8=; 5:yFDj1VEPlGO1QYoKguz3pp6sw8uBBbExWKL7DPZsj7F/2vf9aOw+WHG5l6/5PBX2FsNF5a0qBP5Q6DL7XTP1wHWyS8KIN3Qr9gyq+pmGd2Fw4qub5Qzy/2b6ruMGmI+6DaCLIZrKmp5ckxRmicBa+SdsdMHdua81cGbuUKQT2+0=; 24:w79n1EB2DKM4bnL05uOUtUmyGIroJElkz24qTseIed1HnCI6GekeiCfB8un/kJKGEq8/pMki8eFaZFDmM2x+NMlGyodqa8z/YjgEr50vYYA=; 7:WIRAJFjEyH6Xw+C7Qi4X1v5/XzMmIxqm+IxgD+9Ki0YyFC7SK3eXJ78MfKrOUtHCHTM2/yuKnNzQ1/n8/L2DFw4mQlemYmo8qy9BeQxw5LtPTgiF6UJc4CEWICdjMVDvek3bIS65/qCXwOSWWTa2t9qtrfvqBZidb2qjrYgbcerEx1uMO2AVTQ+8x24270E9aFlh1z9eFJwsPFgAXqhoaMEx84R5sFJGXThpnzqFgppaXavkOLfQcEuRfG/UYW+T SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2017 23:02:28.3430 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0d6d4b1-814f-49c6-9a63-08d526fcc8fa 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: CY1PR02MB1336 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.36.75 Subject: [Qemu-devel] [PATCH v4 33/45] hw/scsi: 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: Alexander Graf , armbru@redhat.com, Paolo Bonzini , alistair23@gmail.com, alistair.francis@xilinx.com, David Gibson 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}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Paolo Bonzini Cc: David Gibson Cc: Alexander Graf Acked-by: David Gibson (virtio_scsi part) --- V2: - Split hw patch into individual directories hw/scsi/lsi53c895a.c | 4 ++-- hw/scsi/spapr_vscsi.c | 49 +++++++++++++++++++++-------------------- hw/scsi/virtio-scsi-dataplane.c | 6 ++--- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 191505df5b..7c9a930e2f 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -14,7 +14,7 @@ */ #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "hw/scsi/scsi.h" @@ -1501,7 +1501,7 @@ again: This is apparently sufficient to beat the drivers into submission. */ if (!(s->sien0 & LSI_SIST0_UDC)) - fprintf(stderr, "inf. loop with UDC masked\n"); + error_report("inf. loop with UDC masked"); lsi_script_scsi_interrupt(s, LSI_SIST0_UDC, 0); lsi_disconnect(s); } else if (s->istat1 & LSI_ISTAT1_SRUN && !s->waiting) { diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c index 360db53ac8..8c4eabcf3d 100644 --- a/hw/scsi/spapr_vscsi.c +++ b/hw/scsi/spapr_vscsi.c @@ -32,6 +32,7 @@ * - Maybe do autosense (PAPR seems to mandate it, linux doesn't care) */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h" @@ -179,7 +180,7 @@ static int vscsi_send_iu(VSCSIState *s, vscsi_req *req, rc = spapr_vio_dma_write(&s->vdev, req->crq.s.IU_data_ptr, &req->iu, length); if (rc) { - fprintf(stderr, "vscsi_send_iu: DMA write failure !\n"); + error_report("vscsi_send_iu: DMA write failure !"); } req->crq.s.valid = 0x80; @@ -197,7 +198,7 @@ static int vscsi_send_iu(VSCSIState *s, vscsi_req *req, rc1 = spapr_vio_send_crq(&s->vdev, req->crq.raw); if (rc1) { - fprintf(stderr, "vscsi_send_iu: Error sending response\n"); + error_report("vscsi_send_iu: Error sending response"); return rc1; } @@ -330,7 +331,7 @@ static int vscsi_fetch_desc(VSCSIState *s, struct vscsi_req *req, break; } default: - fprintf(stderr, "VSCSI: Unknown format %x\n", req->dma_fmt); + error_report("VSCSI: Unknown format %x", req->dma_fmt); return -1; } @@ -518,7 +519,7 @@ static void vscsi_transfer_data(SCSIRequest *sreq, uint32_t len) trace_spapr_vscsi_transfer_data(sreq->tag, len, req); if (req == NULL) { - fprintf(stderr, "VSCSI: Can't find request for tag 0x%x\n", sreq->tag); + error_report("VSCSI: Can't find request for tag 0x%x", sreq->tag); return; } @@ -527,7 +528,7 @@ static void vscsi_transfer_data(SCSIRequest *sreq, uint32_t len) rc = vscsi_srp_transfer_data(s, req, req->writing, buf, len); } if (rc < 0) { - fprintf(stderr, "VSCSI: RDMA error rc=%d!\n", rc); + error_report("VSCSI: RDMA error rc=%d!", rc); req->dma_error = true; scsi_req_cancel(req->sreq); return; @@ -547,7 +548,7 @@ static void vscsi_command_complete(SCSIRequest *sreq, uint32_t status, size_t re trace_spapr_vscsi_command_complete(sreq->tag, status, req); if (req == NULL) { - fprintf(stderr, "VSCSI: Can't find request for tag 0x%x\n", sreq->tag); + error_report("VSCSI: Can't find request for tag 0x%x", sreq->tag); return; } @@ -639,7 +640,7 @@ static void *vscsi_load_request(QEMUFile *f, SCSIRequest *sreq) memset(req, 0, sizeof(*req)); rc = vmstate_load_state(f, &vmstate_spapr_vscsi_req, req, 1); if (rc) { - fprintf(stderr, "VSCSI: failed loading request tag#%u\n", sreq->tag); + error_report("VSCSI: failed loading request tag#%u", sreq->tag); return NULL; } assert(req->active); @@ -827,7 +828,7 @@ static int vscsi_process_tsk_mgmt(VSCSIState *s, vscsi_req *req) uint64_t tag = iu->srp.rsp.tag; uint8_t sol_not = iu->srp.cmd.sol_not; - fprintf(stderr, "vscsi_process_tsk_mgmt %02x\n", + error_report("vscsi_process_tsk_mgmt %02x", iu->srp.tsk_mgmt.tsk_mgmt_func); d = vscsi_device_find(&s->bus, be64_to_cpu(req->iu.srp.tsk_mgmt.lun), &lun); @@ -932,10 +933,10 @@ static int vscsi_handle_srp_req(VSCSIState *s, vscsi_req *req) case SRP_CRED_RSP: case SRP_AER_REQ: case SRP_AER_RSP: - fprintf(stderr, "VSCSI: Unsupported opcode %02x\n", opcode); + error_report("VSCSI: Unsupported opcode %02x", opcode); break; default: - fprintf(stderr, "VSCSI: Unknown type %02x\n", opcode); + error_report("VSCSI: Unknown type %02x", opcode); } return done; @@ -953,7 +954,7 @@ static int vscsi_send_adapter_info(VSCSIState *s, vscsi_req *req) rc = spapr_vio_dma_read(&s->vdev, be64_to_cpu(sinfo->buffer), &info, be16_to_cpu(sinfo->common.length)); if (rc) { - fprintf(stderr, "vscsi_send_adapter_info: DMA read failure !\n"); + error_report("vscsi_send_adapter_info: DMA read failure !"); } #endif memset(&info, 0, sizeof(info)); @@ -967,7 +968,7 @@ static int vscsi_send_adapter_info(VSCSIState *s, vscsi_req *req) rc = spapr_vio_dma_write(&s->vdev, be64_to_cpu(sinfo->buffer), &info, be16_to_cpu(sinfo->common.length)); if (rc) { - fprintf(stderr, "vscsi_send_adapter_info: DMA write failure !\n"); + error_report("vscsi_send_adapter_info: DMA write failure !"); } sinfo->common.status = rc ? cpu_to_be32(1) : 0; @@ -987,7 +988,7 @@ static int vscsi_send_capabilities(VSCSIState *s, vscsi_req *req) req_len = len = be16_to_cpu(vcap->common.length); buffer = be64_to_cpu(vcap->buffer); if (len > sizeof(cap)) { - fprintf(stderr, "vscsi_send_capabilities: capabilities size mismatch !\n"); + error_report("vscsi_send_capabilities: capabilities size mismatch !"); /* * Just read and populate the structure that is known. @@ -997,7 +998,7 @@ static int vscsi_send_capabilities(VSCSIState *s, vscsi_req *req) } rc = spapr_vio_dma_read(&s->vdev, buffer, &cap, len); if (rc) { - fprintf(stderr, "vscsi_send_capabilities: DMA read failure !\n"); + error_report("vscsi_send_capabilities: DMA read failure !"); } /* @@ -1013,7 +1014,7 @@ static int vscsi_send_capabilities(VSCSIState *s, vscsi_req *req) rc = spapr_vio_dma_write(&s->vdev, buffer, &cap, len); if (rc) { - fprintf(stderr, "vscsi_send_capabilities: DMA write failure !\n"); + error_report("vscsi_send_capabilities: DMA write failure !"); } if (req_len > len) { /* @@ -1034,11 +1035,11 @@ static int vscsi_handle_mad_req(VSCSIState *s, vscsi_req *req) switch (be32_to_cpu(mad->empty_iu.common.type)) { case VIOSRP_EMPTY_IU_TYPE: - fprintf(stderr, "Unsupported EMPTY MAD IU\n"); + error_report("Unsupported EMPTY MAD IU"); retlen = sizeof(mad->empty_iu); break; case VIOSRP_ERROR_LOG_TYPE: - fprintf(stderr, "Unsupported ERROR LOG MAD IU\n"); + error_report("Unsupported ERROR LOG MAD IU"); retlen = sizeof(mad->error_log); break; case VIOSRP_ADAPTER_INFO_TYPE: @@ -1053,7 +1054,7 @@ static int vscsi_handle_mad_req(VSCSIState *s, vscsi_req *req) request_handled = true; break; default: - fprintf(stderr, "VSCSI: Unknown MAD type %02x\n", + error_report("VSCSI: Unknown MAD type %02x", be32_to_cpu(mad->empty_iu.common.type)); /* * PAPR+ says that "The length field is set to the length @@ -1078,7 +1079,7 @@ static void vscsi_got_payload(VSCSIState *s, vscsi_crq *crq) req = vscsi_get_req(s); if (req == NULL) { - fprintf(stderr, "VSCSI: Failed to get a request !\n"); + error_report("VSCSI: Failed to get a request !"); return; } @@ -1088,7 +1089,7 @@ static void vscsi_got_payload(VSCSIState *s, vscsi_crq *crq) * of the structure. */ if (crq->s.IU_length > sizeof(union viosrp_iu)) { - fprintf(stderr, "VSCSI: SRP IU too long (%d bytes) !\n", + error_report("VSCSI: SRP IU too long (%d bytes) !", crq->s.IU_length); vscsi_put_req(req); return; @@ -1097,7 +1098,7 @@ static void vscsi_got_payload(VSCSIState *s, vscsi_crq *crq) /* XXX Handle failure differently ? */ if (spapr_vio_dma_read(&s->vdev, crq->s.IU_data_ptr, &req->iu, crq->s.IU_length)) { - fprintf(stderr, "vscsi_got_payload: DMA read failure !\n"); + error_report("vscsi_got_payload: DMA read failure !"); vscsi_put_req(req); return; } @@ -1158,16 +1159,16 @@ static int vscsi_do_crq(struct VIOsPAPRDevice *dev, uint8_t *crq_data) case VIOSRP_AIX_FORMAT: case VIOSRP_LINUX_FORMAT: case VIOSRP_INLINE_FORMAT: - fprintf(stderr, "vscsi_do_srq: Unsupported payload format %02x\n", + error_report("vscsi_do_srq: Unsupported payload format %02x", crq.s.format); break; default: - fprintf(stderr, "vscsi_do_srq: Unknown payload format %02x\n", + error_report("vscsi_do_srq: Unknown payload format %02x", crq.s.format); } break; default: - fprintf(stderr, "vscsi_do_crq: unknown CRQ %02x %02x ...\n", + error_report("vscsi_do_crq: unknown CRQ %02x %02x ...", crq.raw[0], crq.raw[1]); }; diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c index add4b3f4a4..e047361310 100644 --- a/hw/scsi/virtio-scsi-dataplane.c +++ b/hw/scsi/virtio-scsi-dataplane.c @@ -97,7 +97,7 @@ static int virtio_scsi_vring_init(VirtIOSCSI *s, VirtQueue *vq, int n, /* Set up virtqueue notify */ rc = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), n, true); if (rc != 0) { - fprintf(stderr, "virtio-scsi: Failed to set host notifier (%d)\n", + error_report("virtio-scsi: Failed to set host notifier (%d)", rc); s->dataplane_fenced = true; return rc; @@ -141,8 +141,8 @@ int virtio_scsi_dataplane_start(VirtIODevice *vdev) /* Set up guest notifier (irq) */ rc = k->set_guest_notifiers(qbus->parent, vs->conf.num_queues + 2, true); if (rc != 0) { - fprintf(stderr, "virtio-scsi: Failed to set guest notifiers (%d), " - "ensure -enable-kvm is set\n", rc); + error_report("virtio-scsi: Failed to set guest notifiers (%d), " + "ensure -enable-kvm is set", rc); goto fail_guest_notifiers; }