summaryrefslogtreecommitdiff
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
parent95f7142abc86a916682bd735aecd90172ffa0d30 (diff)
downloadqemu-c99495ac1b4a27cb57bf04ed1a169177aeea2649.zip
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>
-rw-r--r--hw/block/virtio-blk.c5
-rw-r--r--include/hw/virtio/virtio-blk.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index d0a01a8864..8c51a295d9 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(),
};
diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
index 2027a64093..fc7d311a43 100644
--- a/include/hw/virtio/virtio-blk.h
+++ b/include/hw/virtio/virtio-blk.h
@@ -113,6 +113,7 @@ struct VirtIOBlkConf
uint32_t scsi;
uint32_t config_wce;
uint32_t data_plane;
+ uint32_t request_merging;
};
struct VirtIOBlockDataPlane;