From patchwork Fri Jan 19 12:50:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10175199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F1B38601E7 for ; Fri, 19 Jan 2018 12:52:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E138228685 for ; Fri, 19 Jan 2018 12:52:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5A2928696; Fri, 19 Jan 2018 12:52:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 000F828685 for ; Fri, 19 Jan 2018 12:52:49 +0000 (UTC) Received: from localhost ([::1]:47353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecWA5-0000T9-3i for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 Jan 2018 07:52:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecW7s-0006po-R2 for qemu-devel@nongnu.org; Fri, 19 Jan 2018 07:50:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecW7q-00038I-5v for qemu-devel@nongnu.org; Fri, 19 Jan 2018 07:50:32 -0500 Received: from mail-db5eur01on0090.outbound.protection.outlook.com ([104.47.2.90]:56398 helo=EUR01-DB5-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 1ecW7p-00037O-S5; Fri, 19 Jan 2018 07:50:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Pc6uK6KgXcRiCjzGql3ZtbSpB8fQpDg3IKJzCBAcmIo=; b=DMW67YLQEdyn1FNrbrPljIasIRaNKCP8flnqUC/XAon9YUpJ5UjI/jYzHTHCAt+j5lTCFtGz3srJJE34ZL5y8RIwQvLycTiL8qS1EDWWB6WElemfevCd8Q+b2phEC4N97PiusT7kicu5EbaqA6WRLBUZmGZbNec44PWj7JHb2/s= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by VI1PR0801MB1999.eurprd08.prod.outlook.com (2603:10a6:800:8a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Fri, 19 Jan 2018 12:50:27 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Fri, 19 Jan 2018 15:50:03 +0300 Message-Id: <1516366207-109842-5-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516366207-109842-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1516366207-109842-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR0202CA0008.eurprd02.prod.outlook.com (2603:10a6:4:29::18) To VI1PR0801MB1999.eurprd08.prod.outlook.com (2603:10a6:800:8a::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5023d96a-8c83-4385-332c-08d55f3b37d9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:VI1PR0801MB1999; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1999; 3:ml96+f8dFQupYuQWEHUq3SDDX+MQwz1trqZlcqueDJZ8u3sJFMbUIsqfQv63j8x+HmOIRNUvpIFgMR1ejnYT+1BTxszsen25o5BZKlb/pk4ehfFxstSnFs+Uz2wLl9Jn1739GimPy4+su6KC1lMTdz5SUc/ZO5+b1Nd82wMQeVZYBmMgrJ3sUBaPdibGOq2LU2jgKMqdoN7w11Cn8rKwxHMul5gkGZtjEhSNGp7PPH+vox+/hV1mTw/KJZTjo+CV; 25:oPSCxFSLwe1rVTHsi3hX4HT/vqfl7IWzDnlR/zqEzn/GW97FWOz7oe+rOIXzmeTiZ0QF7uAC/a+OGkpgaOxy5ThdqNKIOAJfnkJRgknw8HVCOFwIaGRZQOj3s8K3mcbw6mklF519dOkH8V+jJ9ed/BeAEoVK2ZX5EQ6lbe4rWMAR4ADJLVgrFD46fMr7HbbAlUGR+SFb3gtjn/xxnots50oPngNAuheB1A46Wyt6OFKSPdIzyPtemymJGVXcBFTMvx+Y0rif6YZ3G7CY+HX3ec3hXpIn3wfu/DdDmqrBBuYHHpYGkEROfw2IlrvXyfY3GrkZRbdPLVrZVAzNn/1P3g==; 31:0rsDu4v58hXZU4Nbkj6woZYvfCVa8nyNzq8KawnRYpd6tdlkdqEP/xvESdSsz8pGYYjt67yYe1jwUVy+hEh8eGME0AqzIesPDMwBAG7n63Rx34e6A2kpKbdd9VqFTtI/F8wIsBNM2JVCK4fHyMgMsWRwhgob4U8I6BxFKDhkWtyxAtOwSlZ1QFrxq8GlHmn861/SCKwZV7FUX4Fd6OsGzRwjtGmBWromCXHHYTBT+Fw= X-MS-TrafficTypeDiagnostic: VI1PR0801MB1999: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1999; 20:WKgKZFsIp0kIR1i5jc3+PNmZOYUGpf66PZX8gMUpGOlYOvWCs5g6ExPH2q9Nbz1gvTKNSwght2ny5E6K84NHLG3/ABIvsKqZB9r2pRLCwk4Gm05lhgtueeYesFTfwD8vRdbDyFg/fFlmNk0AhgsIfA7KLrdBqz0OF1Xnm30WRsFc4WZc9iuVjYeoUeX+8ci5kS4+D8IjUXnCv+YCRYIui687EFc6RNtnvptq9w3j49zL3FkEOdofr9TK5QAAb03ghOdh9revc+Ia4GS7blISw9Boq28nIn38CtcmvGtvCBzgeoJn0YDGNTde3NXWXKMZybo/LBMpRnA5wWad+9mX3j8/CTTjprU03szLon4mcXU2WfvOkoCeMhmfBSxHHQBTxSUrZJV1cxIdHKodSgd9eInOjtN9mRCTIJDwde67N80=; 4:HPdTsXBrqHGjGPEuxWd9WW6qrtHkj1YhSPjFo9EExXSjv2LtyHIdUV8G0n3zEvwPdz/DVtWayPoG78gj9fO7wQ4OZJU3Xl0uRj6qJ8FECRiN+jFihaNspWVldjBT6SjQRm2wvuX5sWWhuAfzuqJ+BpTFIR0N4GccoXzkI7/ohekWtRkJEomKWf30G7ehM3ro122mv+skvLWOsswam+uu3tP8w9T9fuK4qYTbQBayk1n1YFhBpWazBWJ1SHwlhtL/PrbNf334RS/Er0Ry070EFw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231023)(2400077)(944501161)(10201501046)(6041268)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:VI1PR0801MB1999; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR0801MB1999; X-Forefront-PRVS: 0557CBAD84 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(346002)(39850400004)(376002)(396003)(39380400002)(189003)(199004)(16586007)(5660300001)(53936002)(6666003)(6916009)(6512007)(36756003)(2950100002)(53416004)(6116002)(69596002)(105586002)(6486002)(50466002)(48376002)(2361001)(3846002)(52116002)(81166006)(106356001)(2351001)(66066001)(305945005)(47776003)(107886003)(7736002)(81156014)(86362001)(6506007)(478600001)(8676002)(386003)(575784001)(316002)(2906002)(16526018)(76176011)(4326008)(25786009)(50226002)(68736007)(51416003)(26005)(97736004)(8936002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1999; H:xantnef-ws.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1999; 23:9qPD+An66rv9RE2NtzLO2vglPyVyNJRCdxaqnBs?= =?us-ascii?Q?uVY/jZSJEMDjze6rX7sLsNOHbRGKwwhd80DGmSvcMK9EQNDUTN2OYUgSHidg?= =?us-ascii?Q?+yLp5HzzDrBF/rgbvpSWXxGSYv0uiF8XmnzGQfjO2VgjUmionZc7Gt69hs9y?= =?us-ascii?Q?ER3zhfWwLzAJqQKDJ2cXHXxaoLmlX7Zx0MLCwKq3T4+16/mBcG196I+cGCPa?= =?us-ascii?Q?x7YU1sDdNmGbwEKAJ/e7uRCaUJC7nN8Pdm+g3HJidvyYlaCbMLUuFaUUelss?= =?us-ascii?Q?GEWTznC18R1vb8bsOWFWnxFQtE/qVjIA51y/mjV/Kpe29avsrk82uHwE4Pl8?= =?us-ascii?Q?kbdJcobbgP1QaDoLgWT+HGqNqzctBhh0zHNxkoosXUc+uGcZM+8xNCh9EfIV?= =?us-ascii?Q?1PpUjv7p9P+wkCB4LdD06p0ttMd6VFK3szXUlxA9BUlUnYCW3HLD1LyS4q5p?= =?us-ascii?Q?HbJW2mm1kF6vTsGEb6GU00SF5GLgWF6el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EpP/WoUnGkuk82MQJp5tpsnRAPaISXlGU3SjJxhP8uLCar8+sEcLTDX1YLeF9wPgEgI/aUVahDba1Fz+830iFTSjfxZ/7HlsRqWn9UggPTe35tuq6uxoFtW4IcmOT74NV8PlsSVX1Uquvmq1k5h/dLhKyifFiPnkjKrlVZEcYP5l8kuB5KNZ2ELNoc1Ngt9hXVk/rIzxmKcjDCXGd2GSE=; 5:C7MQVenc2EiyxkQglqOsCDM1zj0QcFDdcjK/LBBs2kK1z7g1PFUWfF7VNLI8QdQN/vxfl998EElOghTj0y+B/nllIIdwBOZlq7rT92G1sB9o66wQZ165pheT4XrrVd26F/SfGm7lBOc1iMUzbdQYzoa8J+qt3B89T1nBVs9C6Bc=; 24:nJX/Udoflyg6facPhu7RijnrGZG1ZiFEIZ9PgnFpkv29Aj/1p7zsKQzYrksnEPFDeuamyLMew4ryVxLy88Zae1Jd+TdUfzoB6BMTHyc5qlE=; 7:B+NYxCLMq2BVXeLxCDcu5du8/zliPeN7vRVP0n8uM8rpkU252GKbvxfaXDAfaQmvMoGrgVPHzUlYTwG0QP8qWBajsormu3FBz9ISX69dQfMwdv5LZDdGIOlFcNRNcmaDnVRAZnsWZVNlfW0b7MLqPIb4OLDgiVb+v+c6b50IRsIS82tpOS3I1UQaSlRkw+CDhB33cYjRts8JC1uXT9qaY6OG1WAwmloGtVNpCd3wQ0T1sLmBbvm7SubNT5QQ+eRs SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1999; 20:2suBAKLM/0uhUfzSMnf61Vqgpi3Sl/6FoGHMOPkok/nwk76dwh8sVnS1YpCCkwXiW+GufuuDJQDt/GkwAc0vxqyhxrGnrTUodCdXU3yr4H4saoJSHR5D74pvKJ3rxfAznYchkpaboQIPOMq0tg3rIuSxacx+oxvyvyIvwcgfZuo= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2018 12:50:27.6077 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5023d96a-8c83-4385-332c-08d55f3b37d9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1999 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.90 Subject: [Qemu-devel] [PATCH v2 4/8] scsi: store unmap offset and nb_sectors in request struct 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: kwolf@redhat.com, Anton Nefedov , den@virtuozzo.com, qemu-block@nongnu.org, armbru@redhat.com, mreitz@redhat.com, pbonzini@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP it allows to report it in the error handler Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- hw/scsi/scsi-disk.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 49d2559..7b8e0ed 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1625,8 +1625,6 @@ static void scsi_unmap_complete_noio(UnmapCBData *data, int ret) { SCSIDiskReq *r = data->r; SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); - uint64_t sector_num; - uint32_t nb_sectors; assert(r->req.aiocb == NULL); if (scsi_disk_req_check_error(r, ret, false)) { @@ -1634,16 +1632,16 @@ static void scsi_unmap_complete_noio(UnmapCBData *data, int ret) } if (data->count > 0) { - sector_num = ldq_be_p(&data->inbuf[0]); - nb_sectors = ldl_be_p(&data->inbuf[8]) & 0xffffffffULL; - if (!check_lba_range(s, sector_num, nb_sectors)) { + r->sector = ldq_be_p(&data->inbuf[0]); + r->sector_count = ldl_be_p(&data->inbuf[8]) & 0xffffffffULL; + if (!check_lba_range(s, r->sector, r->sector_count)) { scsi_check_condition(r, SENSE_CODE(LBA_OUT_OF_RANGE)); goto done; } r->req.aiocb = blk_aio_pdiscard(s->qdev.conf.blk, - sector_num * s->qdev.blocksize, - nb_sectors * s->qdev.blocksize, + r->sector * s->qdev.blocksize, + r->sector_count * s->qdev.blocksize, scsi_unmap_complete, data); data->count--; data->inbuf += 16;