qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/4] hw/virtio-blk: add a constant for max numbe


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH 2/4] hw/virtio-blk: add a constant for max number of merged requests
Date: Wed, 10 Dec 2014 12:54:35 +0800
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, 12/09 17:26, Peter Lieven wrote:
> As it was not obvious (at least for me) where the 32 comes from;
> add a constant for it.
> 
> Signed-off-by: Peter Lieven <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> ---
>  hw/block/virtio-blk.c          |    2 +-
>  include/hw/virtio/virtio-blk.h |    4 +++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> index b19b102..490f961 100644
> --- a/hw/block/virtio-blk.c
> +++ b/hw/block/virtio-blk.c
> @@ -326,7 +326,7 @@ static void virtio_blk_handle_write(VirtIOBlockReq *req, 
> MultiReqBuffer *mrb)
>      block_acct_start(blk_get_stats(req->dev->blk), &req->acct, 
> req->qiov.size,
>                       BLOCK_ACCT_WRITE);
>  
> -    if (mrb->num_writes == 32) {
> +    if (mrb->num_writes == VIRTIO_BLK_MAX_MERGE_REQS) {
>          virtio_submit_multiwrite(req->dev->blk, mrb);
>      }
>  
> diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
> index 3979dc4..3f2652f 100644
> --- a/include/hw/virtio/virtio-blk.h
> +++ b/include/hw/virtio/virtio-blk.h
> @@ -134,8 +134,10 @@ typedef struct VirtIOBlock {
>      struct VirtIOBlockDataPlane *dataplane;
>  } VirtIOBlock;
>  
> +#define VIRTIO_BLK_MAX_MERGE_REQS 32
> +
>  typedef struct MultiReqBuffer {
> -    BlockRequest        blkreq[32];
> +    BlockRequest        blkreq[VIRTIO_BLK_MAX_MERGE_REQS];
>      unsigned int        num_writes;
>  } MultiReqBuffer;
>  
> -- 
> 1.7.9.5
> 
> 

Reviewed-by: Fam Zheng <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]