From patchwork Thu Oct 19 16:17:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828245 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="Mq8K156X"; 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 3yHw3P6GmSz9t44 for ; Fri, 20 Oct 2017 03:53:05 +1100 (AEDT) Received: from localhost ([::1]:50231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E47-0006cT-UZ for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:53:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZu-0005fh-93 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZq-00021g-Ua for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:50 -0400 Received: from mail-cys01nam02on0042.outbound.protection.outlook.com ([104.47.37.42]:57479 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZq-000217-IV for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:46 -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=gNIViipH0bP2OXTPmUcM69t/dc9upyc+PqyUVN5Mu+s=; b=Mq8K156XRMz+fCmJU8lRnRlriE4Fa5b7G1jUNfRZFnjqz+uuJol5ijHnOjOBhFTTaqyPTEHpWbjmRZIo2K7rxxNKdy1+i9KzsRjiyllK+6662jYiMMfcVpI//NdKXNKsCk3Fb3iQAvpEETw691SnFUQPoZOdD+avw5qQKoyYaZk= Received: from BY2PR02CA0115.namprd02.prod.outlook.com (10.163.44.169) by BY2PR02MB1329.namprd02.prod.outlook.com (10.162.79.24) 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:21:44 +0000 Received: from BL2NAM02FT033.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::207) by BY2PR02CA0115.outlook.office365.com (2a01:111:e400:5261::41) 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:21:43 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) 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.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 BL2NAM02FT033.mail.protection.outlook.com (10.152.77.163) 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:21:43 +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 1e5DZm-000059-GP; Thu, 19 Oct 2017 09:21:42 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZm-00039X-DL; Thu, 19 Oct 2017 09:21:42 -0700 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLXBM018081; Thu, 19 Oct 2017 09:21:33 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZd-00038T-4k; Thu, 19 Oct 2017 09:21:33 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:40 -0700 Message-ID: <5d68af196a5b6386f66e6461d1c65b6a935b6ea0.1508390588.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-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.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(2980300002)(438002)(189002)(199003)(81156014)(356003)(33646002)(4326008)(106002)(81166006)(50986999)(2906002)(8936002)(16586007)(47776003)(6916009)(5003940100001)(8676002)(2950100002)(106466001)(189998001)(2351001)(76176999)(5660300001)(39060400002)(6666003)(50226002)(305945005)(63266004)(9786002)(54906003)(48376002)(478600001)(36756003)(118296001)(50466002)(77096006)(316002)(36386004)(107986001)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1329; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT033; 1:zWvr2tr3H/G9f+/nQ6FFYb/COsP1SCN8mr+81sr6nYc5p3y+Yg6OJSjXxQbvUDQ8fAyPqgrd3DH9d7u6xxSDCIwSEpmDQ/oxP8U3/dqbErXM8BZmqhgbryy23pnKdJGl MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 42151ca4-bcd1-4351-2956-08d5170d7c94 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:BY2PR02MB1329; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1329; 3:W+zw9OhUW3/oLuhjNxp2cCAdr+KAEchuRZou74BJT+KbNjsQsXz8Y+YYI3Mf83ZCEh7nYPcdOGoRNlhQYxrDJqXMxzTWgSHToCJpX35x8CWBp0SYX8BHVedeZmeOtzoP7u20r8mkdN1ZOV7gAn3t54cxOtxrWao+uc5pw99RxTcPbyJKoVaN9tknEBTtKG8QWECe/fD1Qb9d5aGBUXaYs7KlTwSJWaBTG42o8TwRPPIhy2SYrdUHCm4z7Shcx1FtOJB6lANwZLJGf0fPGP52o+6ohx5h5lWSlzLUmqOZmx+7sOgKskolnwUFDVhc6PYVRsrJMW7nbYjXZ1HpiUVzc5wUTskUgMTZww5yEsmzJhY=; 25:MXKr/GyIURSC198woWQrbIvZB8eXDyk1eKIUVaHbScmeJxPR2GLVfa4VxBvWWdpQAIZzj9coJnyuqpjsrrjCPjQGYDNHlHMcPqC7hGhy79K/KNJglEHTEqnzBP2yrJi42J26lZHlC8Yciw/gVllLIDKDJMFzLcDHOwPcp5zv7MsNWeftxnHUAgZiRaoY6BCKHf7Lvfb3uYSbzuUuCCvGEVINZDBK9mokB67r27jmJUoukIQl0nkOJnyIriG4gWronz8QX4LKDZKFUEj0WJr3N9MqAg61vscstDimt0zbSLnjjk87pw7tiY5rWMvxGfAKur+C/ABav6sYikC/VgQ+Iw== X-MS-TrafficTypeDiagnostic: BY2PR02MB1329: X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1329; 31:Ti/Fj3PNlVwVbMnA0L0DPSaYrpDg44OxiyCDx7P64OiI6K8omfhTRid+aKuHshccYhNPi/pPIxfjp9odTiaH3sfGjpRKeODaWp8bfBsqV+WcLNZSRy2Eb0svAsg4S5HQX5wp4s2yYzYzmODN08nnxuvxj8hKNcwkvUFkcKyEjffPosm8KlaUFk4iqHWafC0zq4TzzUFvP0lV+7iNwHYgokFMZJlxdyiWFsMRUPDGTbI=; 20:h0hxoPCiJg5JgRLb+SLMabL+Gt5cBQ2mfq9drH5wFNgMNOoTa5adMNt/QYHKJ4FB71WVPpKm0qVkbpOwZATzCDOEVZOtTxufinMbTZddCPXZIOKRysteNhoYZn8xF/3Jkv72WGwUA1j2KcvfV9UOfLuTxv52VRFReUeDps23TlR0v6fYB5CkW8Aw9N5/B2tL2p80EN5Gu0vbuTGDJMvzFuLqHBfA01g2pKJPo7CAuFbtUfyqm0N6mTrSQHjxa1TRRLrWdYPnjmAaCg96Zt1d9t3EJJmGKKss24DHsy2QEJcmG34IUoHLU/jN24HaOA13Ap0t9omCsqxPiefybW7lDkprtLp6wlHO5Iqbo92O1z3GSVwhwkb6SP6Ch7JNmB+fa3Z9Igrw3HdHke2Sxm0FRwAsFwQzaIN0VDwpyEuyDZqcy0NtJtOx42ZqLIjONTXNqSoYdc/v1YQ10zbrlybiWEnf7LoomaiUPTRIxLAWxIuFddWzbKCUIRoK2vI5V88+ 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)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR02MB1329; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR02MB1329; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1329; 4:jCWddkoTuzviBlwxzjTLSmpM9jKCQ67ZEonMft7QwgvW37dziupO/6WYY7wO/OZbfz3DKBS9qwcysYG6ztY2zUbVhUx2sGj7r9NF1Z6+AJwXH3C7uAMbuksXKtdbLW9tOADEx+faNcvjO00ipCOboZMvj5orD6MF2Z2xrQoGHA0fXkCL2ny4lGpec0U5H7PK5yukBG+8LvOvQ3Do94G6JPRm5SsUmB+Y3jAtPGD7IrWPCKY3ZIGrMVjIgCq7zdGYBacRBBIDKzpT7qipvjD+NCSGmSkkvHw7o8KqLfofC3sQYhwCjh1U4d120l2/PLMVGyUW80YFvDvtLbFyha0DQw== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR02MB1329; 23:M+T9vC0tqx3UcrduJUxIBenupQBp22MkedFkDu35B?= e6u0u4uH4aISAULZTjcc+Bko+8lPY9a4Pud/gVJncg7HkWs4OgGjJ4twqBYg/MhJpSRvyQr1PPLNEBbI7hLjKxQn36gTh1YYEkYQzbO/xrIWFBRgMkh381oqYt3QDmlP0vG0CmdJYG/epQ3hNqBIycQ4V2iO36aIpWApp1mMuAYtX7rum6Yc6lEMSbo+YRjnzA8jI5+uLL7Dkw6WvAXQh5qgvdbpSc8zqRyBswXksd6AGOC9NlFa9I4jStulFU4QwKpljhsE+vgvO6xkvu19ppaOjGIOJuJxrnEzIKsQumYMZNen9GWVbJl/+/UhFS+yJf5BFzMXZz7g44pJpNvnn3MBXLFPipYCbqHYQKyIq0K5jPYRU+J1MvRvIVFeY0GbgNKHsvl8h2sDUOr9JIPtuAj3rd0SEQaBJqz5PZMzhTS3+CfdmU94yTzvPYg2BvL3f4RWgn+j6pPPrOk92P1S+CmX6QIB7MCfd2CoA/PVJalOKjRHrOG0flUQ3qqqLBqI7usIeK+91DEaVVT7ILuCLgkrWn7WhYywKUZucS7IWRY5MkkIepukKMMsQRa1FjMMtGrcYsRHbdLJxyhnY0w/aps9D32/iJzvpBjvQ0VTwRDr6Grmifg/RVeMgyVmcMzHv7oBxEP77XyBBG4NS/bwIdj/7od4ekuZvkUQ/3ILaZI/SXYTnQ9qZ7G3KmozHeFkLQDGysU3tMusbmmqLRihjf3IJnSTRUpDOXxSPfQnDkAGfFaouFTV/RUP86P3MkgxKi9IUrZLMgBtI9f4kF1DGbqJT1wA6196m6u5Z2JEcZk9Agf1W9MwHhz+1fmbsbxewJRA7L83NYr7Nl87Jqls0a8104RUZkU/SHl3UIdj8DFeQN7G7MA+7o5TnbUTh1FraHtEzEnDmrpOvbUm33yWeX1WYtoQa5KHa/iT+bg7YAnIJ+O95r+rX08HmtHJA7hRolWFnioJBcFJtv9a5PUeLFY7ukOZBE77ulVMQOzcX40IJ+bC3pM0y8QssV1WutC82kOfbzZwqStlXK7Yy7n7muP X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1329; 6:8LHGn3BxnA9E4PEgUpacjxG68PFf8FaDpF+aUbz5PBXykBQO7ImikGWAgyRGrOpqFHa3N86nJcKdl1XUHYAtnD9eG0Crs23Ejg2iX+F41MsCH7VG3X0wzpqBkSVlUYd/qU7oW5TmgyYsEcXqbOjWKjwliu/LT4LS240axaorqHAPLqK50Br6Qxjpq0//2gXTRo4Ve/2cI89amY9t++1NSCk2jHTD7uPpriNE8XsqtqCxSibMdkGqhTnXXpZMFlB1qfkCQ43aKh/nihaAFoHylJI1VufmfBm08UJjMNSE4XrevXrqfCXxyeOuF3SULgI35RKyAnuczt0jTzrKdyRnCw==; 5:/ZOVlPfpHaMYn6e38iOEewptfq3Tsii4tfc+tt2vHY0t0Q1UdlGbOkIo2pLtpJE8Rp5GQgEwLdpuuEoAvygSidxUpQUVvHEBKrR1sNb48JAJfmE6YbAqZPto9mMLZtlG1LbHsti6IF1E9F2vYlWMmw==; 24:F3f1h+1rLIg1pKoTd8oc/t8gvmmlaSV8eOdUSp5MBJxzoXe4waweI+0cEiATKPDy/vii42E/9oqf/eniK0t7E+KaOBS7v/ZeOYzMnVRmf34=; 7:S2h4ja02fhHa2kA6L+vGKLV8q6o2KvymW5r6IySnlxo5JeexLBV9DC4eg/gljS/iMGCxzlywZVuTOssmUN9KPDHNdyo8UZGK3ZSkLqcDJEahqCSHz2kwhLB7UQ/tgWtkx6IhA/LyVIHlyelrtY8mZqOYo+/bZsslK1G0arSpJ9jBcBXJLck1CugHeHR5rTUuJ0Hl+4v4r1/aF0tKEfx2SaZvMKjKFAVWe6BA1zkSMNc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:43.1766 (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: BY2PR02MB1329 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.42 Subject: [Qemu-devel] [PATCH v3 33/46] 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 --- 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; }