qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] Block patches
@ 2018-12-12  9:52 Stefan Hajnoczi
  2018-12-12  9:52 ` [Qemu-devel] [PULL 1/2] virtio-blk: rename iov to out_iov in virtio_blk_handle_request() Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2018-12-12  9:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Fam Zheng, Michael S. Tsirkin, Max Reitz,
	Peter Maydell, Stefan Hajnoczi, qemu-block

The following changes since commit bb9bf94b3e8926553290bc9a7cb84315af422086:

  Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2018-12-11 19:18:58 +0000)

are available in the Git repository at:

  git://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to e61809ed8ac3a2f68eb1cc231244f84eb06adacf:

  virtio-blk: fix comment for virtio_blk_rw_complete as nalloc is initially -1 (2018-12-12 09:16:55 +0000)

----------------------------------------------------------------
Pull request

Minor virtio-blk fixes.

----------------------------------------------------------------

Dongli Zhang (2):
  virtio-blk: rename iov to out_iov in virtio_blk_handle_request()
  virtio-blk: fix comment for virtio_blk_rw_complete as nalloc is
    initially -1

 hw/block/virtio-blk.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

-- 
2.19.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 1/2] virtio-blk: rename iov to out_iov in virtio_blk_handle_request()
  2018-12-12  9:52 [Qemu-devel] [PULL 0/2] Block patches Stefan Hajnoczi
@ 2018-12-12  9:52 ` Stefan Hajnoczi
  2018-12-12  9:52 ` [Qemu-devel] [PULL 2/2] virtio-blk: fix comment for virtio_blk_rw_complete as nalloc is initially -1 Stefan Hajnoczi
  2018-12-13 13:05 ` [Qemu-devel] [PULL 0/2] Block patches Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2018-12-12  9:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Fam Zheng, Michael S. Tsirkin, Max Reitz,
	Peter Maydell, Stefan Hajnoczi, qemu-block, Dongli Zhang

From: Dongli Zhang <dongli.zhang@oracle.com>

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 <dongli.zhang@oracle.com>
Message-id: 1541520556-8334-1-git-send-email-dongli.zhang@oracle.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 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 83cf5c01f9..fb0d74da07 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 {
-- 
2.19.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 2/2] virtio-blk: fix comment for virtio_blk_rw_complete as nalloc is initially -1
  2018-12-12  9:52 [Qemu-devel] [PULL 0/2] Block patches Stefan Hajnoczi
  2018-12-12  9:52 ` [Qemu-devel] [PULL 1/2] virtio-blk: rename iov to out_iov in virtio_blk_handle_request() Stefan Hajnoczi
@ 2018-12-12  9:52 ` Stefan Hajnoczi
  2018-12-13 13:05 ` [Qemu-devel] [PULL 0/2] Block patches Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2018-12-12  9:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Fam Zheng, Michael S. Tsirkin, Max Reitz,
	Peter Maydell, Stefan Hajnoczi, qemu-block, Dongli Zhang

From: Dongli Zhang <dongli.zhang@oracle.com>

The initial value of nalloc is -1, but not 1.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-id: 1541479952-32355-1-git-send-email-dongli.zhang@oracle.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/block/virtio-blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index fb0d74da07..f208c6ddb9 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -96,7 +96,7 @@ static void virtio_blk_rw_complete(void *opaque, int ret)
         trace_virtio_blk_rw_complete(vdev, req, ret);
 
         if (req->qiov.nalloc != -1) {
-            /* If nalloc is != 1 req->qiov is a local copy of the original
+            /* If nalloc is != -1 req->qiov is a local copy of the original
              * external iovec. It was allocated in submit_requests to be
              * able to merge requests. */
             qemu_iovec_destroy(&req->qiov);
-- 
2.19.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL 0/2] Block patches
  2018-12-12  9:52 [Qemu-devel] [PULL 0/2] Block patches Stefan Hajnoczi
  2018-12-12  9:52 ` [Qemu-devel] [PULL 1/2] virtio-blk: rename iov to out_iov in virtio_blk_handle_request() Stefan Hajnoczi
  2018-12-12  9:52 ` [Qemu-devel] [PULL 2/2] virtio-blk: fix comment for virtio_blk_rw_complete as nalloc is initially -1 Stefan Hajnoczi
@ 2018-12-13 13:05 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2018-12-13 13:05 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: QEMU Developers, Kevin Wolf, Fam Zheng, Michael S. Tsirkin,
	Max Reitz, Qemu-block

On Wed, 12 Dec 2018 at 09:53, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> The following changes since commit bb9bf94b3e8926553290bc9a7cb84315af422086:
>
>   Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2018-12-11 19:18:58 +0000)
>
> are available in the Git repository at:
>
>   git://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to e61809ed8ac3a2f68eb1cc231244f84eb06adacf:
>
>   virtio-blk: fix comment for virtio_blk_rw_complete as nalloc is initially -1 (2018-12-12 09:16:55 +0000)
>
> ----------------------------------------------------------------
> Pull request
>
> Minor virtio-blk fixes.
>
> ----------------------------------------------------------------
>
> Dongli Zhang (2):
>   virtio-blk: rename iov to out_iov in virtio_blk_handle_request()
>   virtio-blk: fix comment for virtio_blk_rw_complete as nalloc is
>     initially -1
>

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-13 13:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-12  9:52 [Qemu-devel] [PULL 0/2] Block patches Stefan Hajnoczi
2018-12-12  9:52 ` [Qemu-devel] [PULL 1/2] virtio-blk: rename iov to out_iov in virtio_blk_handle_request() Stefan Hajnoczi
2018-12-12  9:52 ` [Qemu-devel] [PULL 2/2] virtio-blk: fix comment for virtio_blk_rw_complete as nalloc is initially -1 Stefan Hajnoczi
2018-12-13 13:05 ` [Qemu-devel] [PULL 0/2] Block patches Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).