hw/virtio-blk: add a constant for max number of merged requests

As it was not obvious (at least for me) where the 32 comes from;
add a constant for it.

Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Peter Lieven 2015-02-02 14:52:19 +01:00 committed by Kevin Wolf
parent f4564d53c6
commit d901f3c457
2 changed files with 4 additions and 2 deletions

View File

@ -360,7 +360,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);
}

View File

@ -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;