From patchwork Tue Nov 6 16:09:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongli Zhang X-Patchwork-Id: 10670773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88BE014E2 for ; Tue, 6 Nov 2018 16:08:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77889299C9 for ; Tue, 6 Nov 2018 16:08:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68BC9299EA; Tue, 6 Nov 2018 16:08:45 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SUBJ_OBFU_PUNCT_FEW, SUBJ_OBFU_PUNCT_MANY,UNPARSEABLE_RELAY 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 0033A299C9 for ; Tue, 6 Nov 2018 16:08:44 +0000 (UTC) Received: from localhost ([::1]:41881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK3uF-0003j4-Gm for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Nov 2018 11:08:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK3tQ-0002Bu-ET for qemu-devel@nongnu.org; Tue, 06 Nov 2018 11:07:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gK3tO-0007zl-MQ for qemu-devel@nongnu.org; Tue, 06 Nov 2018 11:07:52 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:37818) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gK3tF-0007RD-Lb; Tue, 06 Nov 2018 11:07:41 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA6G4IvI176014; Tue, 6 Nov 2018 16:07:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=ikCMdlxOYrVcn4eApQ3yx2UTQoyjyF81og7oiM/ZtMg=; b=v8K12Ey8SUx5oXJYFZkpccsGQ9CiwAvrddeKljCoqvJ4Bca5TbKxeQ0BHzG9hp10dkkk tKS6dLuHAlgwqU2k4HL5ILZqO4Ci7yUS86m+qNYUWzcjhRMcYOVGG5No79q/4BW+3ZSE B3PClo9TGkA91EsZZA2jR4GdxLrFM5sdNo6z9nIzgc807IOqfXqBWOjARoZpFz+aIuH6 Qdxm4a8tZkJ7aufmyQj5X5ZMFZVXoriAjxBj37PAqVotrC2JHNMvOJWOxMsPsJcgP13j 82WJ0rfHu3Yp/wlYACTkmQB4lYhYlV2nng7vqM9svBPostZ6O5IJQENs7tno08qWru1I dQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2nh4aqp33a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Nov 2018 16:07:25 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wA6G7Oft023728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 6 Nov 2018 16:07:24 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wA6G7OlB006263; Tue, 6 Nov 2018 16:07:24 GMT Received: from linux.cn.oracle.com (/10.182.71.9) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 06 Nov 2018 08:07:24 -0800 From: Dongli Zhang To: qemu-block@nongnu.org Date: Wed, 7 Nov 2018 00:09:16 +0800 Message-Id: <1541520556-8334-1-git-send-email-dongli.zhang@oracle.com> X-Mailer: git-send-email 2.7.4 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9069 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=738 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811060141 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 Subject: [Qemu-devel] [PATCH 1/1] virtio-blk: rename iov to out_iov in virtio_blk_handle_request() 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, mreitz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP In virtio_blk_handle_request(), in_iov is used for input header while iov is used for output header. Rename iov to out_iov to pair output header's name with in_iov to avoid confusing people when reading source code. Signed-off-by: Dongli Zhang --- hw/block/virtio-blk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 83cf5c0..fb0d74d 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -482,7 +482,7 @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb) { uint32_t type; struct iovec *in_iov = req->elem.in_sg; - struct iovec *iov = req->elem.out_sg; + struct iovec *out_iov = req->elem.out_sg; unsigned in_num = req->elem.in_num; unsigned out_num = req->elem.out_num; VirtIOBlock *s = req->dev; @@ -493,13 +493,13 @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb) return -1; } - if (unlikely(iov_to_buf(iov, out_num, 0, &req->out, + if (unlikely(iov_to_buf(out_iov, out_num, 0, &req->out, sizeof(req->out)) != sizeof(req->out))) { virtio_error(vdev, "virtio-blk request outhdr too short"); return -1; } - iov_discard_front(&iov, &out_num, sizeof(req->out)); + iov_discard_front(&out_iov, &out_num, sizeof(req->out)); if (in_iov[in_num - 1].iov_len < sizeof(struct virtio_blk_inhdr)) { virtio_error(vdev, "virtio-blk request inhdr too short"); @@ -526,7 +526,7 @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb) &req->out.sector); if (is_write) { - qemu_iovec_init_external(&req->qiov, iov, out_num); + qemu_iovec_init_external(&req->qiov, out_iov, out_num); trace_virtio_blk_handle_write(vdev, req, req->sector_num, req->qiov.size / BDRV_SECTOR_SIZE); } else {