qemu-devel
[Top][All Lists]
Advanced

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

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


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 4/4] hw/virtio-blk: add a constant for max number of merged requests
Date: Mon, 20 Oct 2014 17:51:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2

On 20.10.2014 at 16:35, Peter Lieven wrote:
As it was not obvious (at least for me) where the 32 comes from
add a constant for it.

This needs some separator ("...comes from; add a..." or something like that).

Signed-off-by: Peter Lieven <address@hidden>
---
  hw/block/virtio-blk.c |    4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 6051027..23bc948 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -308,6 +308,8 @@ static bool virtio_blk_sect_range_ok(VirtIOBlock *dev,
      return true;
  }
+#define MAX_MERGED_REQS 32
+
  static void virtio_blk_handle_write(VirtIOBlockReq *req, MultiReqBuffer *mrb)
  {
      BlockRequest *blkreq;
@@ -326,7 +328,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 == MAX_MERGED_REQS) {
          virtio_submit_multiwrite(req->dev->blk, mrb);
      }

I wouldn't have used the past form, but simply MAX_MERGE_REQS or, more complicated, MAX_MERGE_REQ_COUNT. But I'm me, and this mail's "From" field says it's not from me.

Reviewed-by: Max Reitz <address@hidden>



reply via email to

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