aboutsummaryrefslogtreecommitdiff
path: root/hw/block
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2015-02-02 14:52:22 +0100
committerKevin Wolf <kwolf@redhat.com>2015-02-06 17:24:21 +0100
commitc99495ac1b4a27cb57bf04ed1a169177aeea2649 (patch)
tree652bb0df118f435fd27a9c4e7df65bd04d9bd3d1 /hw/block
parent95f7142abc86a916682bd735aecd90172ffa0d30 (diff)
downloadqemu-c99495ac1b4a27cb57bf04ed1a169177aeea2649.zip
qemu-c99495ac1b4a27cb57bf04ed1a169177aeea2649.tar.gz
qemu-c99495ac1b4a27cb57bf04ed1a169177aeea2649.tar.bz2
virtio-blk: add a knob to disable request merging
this adds a knob to disable request merging for debugging or benchmarks if dedired. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/block')
-rw-r--r--hw/block/virtio-blk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index d0a01a8..8c51a29 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -531,7 +531,8 @@ void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
/* merge would exceed maximum number of requests or IO direction
* changes */
if (mrb->num_reqs > 0 && (mrb->num_reqs == VIRTIO_BLK_MAX_MERGE_REQS ||
- is_write != mrb->is_write)) {
+ is_write != mrb->is_write ||
+ !req->dev->conf.request_merging)) {
virtio_blk_submit_multireq(req->dev->blk, mrb);
}
@@ -950,6 +951,8 @@ static Property virtio_blk_properties[] = {
#ifdef __linux__
DEFINE_PROP_BIT("scsi", VirtIOBlock, conf.scsi, 0, true),
#endif
+ DEFINE_PROP_BIT("request-merging", VirtIOBlock, conf.request_merging, 0,
+ true),
DEFINE_PROP_BIT("x-data-plane", VirtIOBlock, conf.data_plane, 0, false),
DEFINE_PROP_END_OF_LIST(),
};