* [Qemu-devel] [PATCH 1/2] block: add the support to drain throttled requests
@ 2012-03-27 4:34 zwu.kernel
0 siblings, 0 replies; 2+ messages in thread
From: zwu.kernel @ 2012-03-27 4:34 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha, kvm, zwu.kernel, Zhi Yong Wu, pbonzini
From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
block.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/block.c b/block.c
index b88ee90..1fbf4dd 100644
--- a/block.c
+++ b/block.c
@@ -862,8 +862,22 @@ void bdrv_close_all(void)
void bdrv_drain_all(void)
{
BlockDriverState *bs;
+ bool busy;
- qemu_aio_flush();
+ do {
+ busy = false;
+ qemu_aio_flush();
+
+ /* FIXME: We do not have timer support here, so this is effectively
+ * a busy wait.
+ */
+ QTAILQ_FOREACH(bs, &bdrv_states, list) {
+ if (!qemu_co_queue_empty(&bs->throttled_reqs)) {
+ qemu_co_queue_restart_all(&bs->throttled_reqs);
+ busy = true;
+ }
+ }
+ } while (busy);
/* If requests are still pending there is a bug somewhere */
QTAILQ_FOREACH(bs, &bdrv_states, list) {
--
1.7.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Qemu-devel] [PATCH 1/2] block: add the support to drain throttled requests
@ 2012-03-27 5:55 zwu.kernel
0 siblings, 0 replies; 2+ messages in thread
From: zwu.kernel @ 2012-03-27 5:55 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha, kvm, zwu.kernel, Zhi Yong Wu, pbonzini
From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
block.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/block.c b/block.c
index b88ee90..1fbf4dd 100644
--- a/block.c
+++ b/block.c
@@ -862,8 +862,22 @@ void bdrv_close_all(void)
void bdrv_drain_all(void)
{
BlockDriverState *bs;
+ bool busy;
- qemu_aio_flush();
+ do {
+ busy = false;
+ qemu_aio_flush();
+
+ /* FIXME: We do not have timer support here, so this is effectively
+ * a busy wait.
+ */
+ QTAILQ_FOREACH(bs, &bdrv_states, list) {
+ if (!qemu_co_queue_empty(&bs->throttled_reqs)) {
+ qemu_co_queue_restart_all(&bs->throttled_reqs);
+ busy = true;
+ }
+ }
+ } while (busy);
/* If requests are still pending there is a bug somewhere */
QTAILQ_FOREACH(bs, &bdrv_states, list) {
--
1.7.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-27 5:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-27 5:55 [Qemu-devel] [PATCH 1/2] block: add the support to drain throttled requests zwu.kernel
-- strict thread matches above, loose matches on Subject: below --
2012-03-27 4:34 zwu.kernel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).