aboutsummaryrefslogtreecommitdiff
path: root/hw/block/virtio-blk.c
diff options
context:
space:
mode:
authorSergio Lopez <slp@redhat.com>2020-06-03 11:32:39 +0200
committerKevin Wolf <kwolf@redhat.com>2020-06-17 14:53:39 +0200
commit7aa1c247b466870b0704d3ccdc3755e5e7394dca (patch)
treed189203f115645e4e3c426d22a1abae6b4d33121 /hw/block/virtio-blk.c
parent5fb0a6b5e771b235275acc8af7da490de072917b (diff)
downloadqemu-7aa1c247b466870b0704d3ccdc3755e5e7394dca.zip
qemu-7aa1c247b466870b0704d3ccdc3755e5e7394dca.tar.gz
qemu-7aa1c247b466870b0704d3ccdc3755e5e7394dca.tar.bz2
virtio-blk: Refactor the code that processes queued requests
Move the code that processes queued requests from virtio_blk_dma_restart_bh() to its own, non-static, function. This will allow us to call it from the virtio_blk_data_plane_start() in a future patch. Signed-off-by: Sergio Lopez <slp@redhat.com> Message-Id: <20200603093240.40489-2-slp@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/block/virtio-blk.c')
-rw-r--r--hw/block/virtio-blk.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index f5f6fc9..978574e 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -819,15 +819,11 @@ static void virtio_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq)
virtio_blk_handle_output_do(s, vq);
}
-static void virtio_blk_dma_restart_bh(void *opaque)
+void virtio_blk_process_queued_requests(VirtIOBlock *s)
{
- VirtIOBlock *s = opaque;
VirtIOBlockReq *req = s->rq;
MultiReqBuffer mrb = {};
- qemu_bh_delete(s->bh);
- s->bh = NULL;
-
s->rq = NULL;
aio_context_acquire(blk_get_aio_context(s->conf.conf.blk));
@@ -855,6 +851,16 @@ static void virtio_blk_dma_restart_bh(void *opaque)
aio_context_release(blk_get_aio_context(s->conf.conf.blk));
}
+static void virtio_blk_dma_restart_bh(void *opaque)
+{
+ VirtIOBlock *s = opaque;
+
+ qemu_bh_delete(s->bh);
+ s->bh = NULL;
+
+ virtio_blk_process_queued_requests(s);
+}
+
static void virtio_blk_dma_restart_cb(void *opaque, int running,
RunState state)
{