[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 42/43] qtest: Fix deadloop by running main loop AIO
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 42/43] qtest: Fix deadloop by running main loop AIO context's timers |
Date: |
Tue, 24 Feb 2015 15:48:17 -0600 |
From: Fam Zheng <address@hidden>
qemu_clock_run_timers() only takes care of main_loop_tlg, we shouldn't
forget aio timer list groups.
Currently, the qemu_clock_deadline_ns_all (a few lines above) counts all
the timergroups of this clock type, including aio tlg, but we don't fire
them, so they are never cleared, which makes a dead loop.
For example, this function hangs when trying to drive throttled block
request queue with qtest clock_step.
Signed-off-by: Fam Zheng <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
(cherry picked from commit efef88b3d9ad4325172ed288032807fa88d683cc)
Signed-off-by: Michael Roth <address@hidden>
---
cpus.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cpus.c b/cpus.c
index 0c33458..ff555e2 100644
--- a/cpus.c
+++ b/cpus.c
@@ -372,15 +372,19 @@ static void icount_warp_rt(void *opaque)
void qtest_clock_warp(int64_t dest)
{
int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
+ AioContext *aio_context;
assert(qtest_enabled());
+ aio_context = qemu_get_aio_context();
while (clock < dest) {
int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
int64_t warp = qemu_soonest_timeout(dest - clock, deadline);
+
seqlock_write_lock(&timers_state.vm_clock_seqlock);
timers_state.qemu_icount_bias += warp;
seqlock_write_unlock(&timers_state.vm_clock_seqlock);
qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL);
+ timerlist_run_timers(aio_context->tlg.tl[QEMU_CLOCK_VIRTUAL]);
clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
}
qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
--
1.9.1
- [Qemu-devel] [PATCH 36/43] target-arm/translate-a64: Fix wrong mmu_idx usage for LDT/STT, (continued)
- [Qemu-devel] [PATCH 36/43] target-arm/translate-a64: Fix wrong mmu_idx usage for LDT/STT, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 34/43] sb16: fix interrupt acknowledgement, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 35/43] hw/input/hid.c Fix capslock hid code, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 39/43] libcacard: stop linking against every single 3rd party library, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 37/43] vfio-pci: Fix missing unparent of dynamically allocated MemoryRegion, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 38/43] qemu-thread: fix qemu_event without futexes, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 40/43] fix mc146818rtc wrong subsection name to avoid vmstate_subsection_load() fail, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 03/43] block/vvfat: qcow driver may not be found, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 43/43] exec: change default exception_index value for migration to -1, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 41/43] block/iscsi: fix uninitialized variable, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 42/43] qtest: Fix deadloop by running main loop AIO context's timers,
Michael Roth <=
- [Qemu-devel] [PATCH 06/43] qemu-img: Check create_opts before image creation, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 04/43] block/nfs: Add create_opts, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 08/43] iotests: Only kill NBD server if it runs, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 05/43] block: Check create_opts before image creation, Michael Roth, 2015/02/24
- [Qemu-devel] [PATCH 07/43] qemu-img: Check create_opts before image amendment, Michael Roth, 2015/02/24
- Re: [Qemu-devel] [Qemu-stable] Patch Round-up for stable 2.2.1, freeze on 2015-03-05, Gonglei (Arei), 2015/02/24
- Re: [Qemu-devel] Patch Round-up for stable 2.2.1, freeze on 2015-03-05, Leon Alrae, 2015/02/25