* [Qemu-devel] [PATCH 1/1] virtio-blk: rename iov to out_iov in virtio_blk_handle_request()
@ 2018-11-06 16:09 Dongli Zhang
2018-11-14 14:02 ` Dongli Zhang
2018-11-14 14:40 ` Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Dongli Zhang @ 2018-11-06 16:09 UTC (permalink / raw)
To: qemu-block; +Cc: qemu-devel, stefanha, mst, kwolf, mreitz
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>
---
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 {
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] virtio-blk: rename iov to out_iov in virtio_blk_handle_request()
2018-11-06 16:09 [Qemu-devel] [PATCH 1/1] virtio-blk: rename iov to out_iov in virtio_blk_handle_request() Dongli Zhang
@ 2018-11-14 14:02 ` Dongli Zhang
2018-11-14 14:40 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Dongli Zhang @ 2018-11-14 14:02 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, mreitz, qemu-devel, stefanha, mst
Ping?
Thanks!
Dongli Zhang
On 11/07/2018 12:09 AM, Dongli Zhang wrote:
> 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>
> ---
> 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 {
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] virtio-blk: rename iov to out_iov in virtio_blk_handle_request()
2018-11-06 16:09 [Qemu-devel] [PATCH 1/1] virtio-blk: rename iov to out_iov in virtio_blk_handle_request() Dongli Zhang
2018-11-14 14:02 ` Dongli Zhang
@ 2018-11-14 14:40 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2018-11-14 14:40 UTC (permalink / raw)
To: Dongli Zhang; +Cc: qemu-block, qemu-devel, mst, kwolf, mreitz
[-- Attachment #1: Type: text/plain, Size: 552 bytes --]
On Wed, Nov 07, 2018 at 12:09:16AM +0800, Dongli Zhang wrote:
> 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>
> ---
> hw/block/virtio-blk.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Thanks, applied to my block-next tree:
https://github.com/stefanha/qemu/commits/block-next
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-14 14:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-06 16:09 [Qemu-devel] [PATCH 1/1] virtio-blk: rename iov to out_iov in virtio_blk_handle_request() Dongli Zhang
2018-11-14 14:02 ` Dongli Zhang
2018-11-14 14:40 ` Stefan Hajnoczi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.