代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/qemu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 21c5ffb363930dfe6213bb677c5811fede3bcee2 Mon Sep 17 00:00:00 2001
From: Sergio Lopez <slp(a)redhat.com>
Date: Thu, 21 Jan 2021 15:46:51 +0800
Subject: [PATCH] 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(a)redhat.com>
Message-Id: <20200603093240.40489-2-slp(a)redhat.com>
Signed-off-by: Kevin Wolf <kwolf(a)redhat.com>
---
hw/block/virtio-blk.c | 16 +++++++++++-----
include/hw/virtio/virtio-blk.h | 1 +
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 703ed4c93b..cee2c673a5 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -809,15 +809,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));
@@ -845,6 +841,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)
{
diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
index cddcfbebe9..cf8eea2f58 100644
--- a/include/hw/virtio/virtio-blk.h
+++ b/include/hw/virtio/virtio-blk.h
@@ -84,5 +84,6 @@ typedef struct MultiReqBuffer {
} MultiReqBuffer;
bool virtio_blk_handle_vq(VirtIOBlock *s, VirtQueue *vq);
+void virtio_blk_process_queued_requests(VirtIOBlock *s);
#endif
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。