[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 42/65] qtest: Fix deadloop by running main loop AI
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v2 42/65] qtest: Fix deadloop by running main loop AIO context's timers |
Date: |
Mon, 16 Feb 2015 15:46:07 +0000 |
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>
---
cpus.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cpus.c b/cpus.c
index 0cdd1d7..97939e4 100644
--- a/cpus.c
+++ b/cpus.c
@@ -361,15 +361,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);
--
2.1.0
- [Qemu-devel] [PULL v2 34/65] libqos/ahci: Add ahci_guest_io, (continued)
- [Qemu-devel] [PULL v2 34/65] libqos/ahci: Add ahci_guest_io, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 31/65] libqos/ahci: add ahci command functions, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 36/65] libqos/ahci: Add ahci_clean_mem, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 33/65] libqos/ahci: add ahci command size setters, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 35/65] libqos/ahci: add ahci_io, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 41/65] block: vmdk - fixed sizeof() error, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 43/65] qemu-io: Account IO by aio_read and aio_write, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 38/65] qtest/ahci: Adding simple dma read-write test, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 40/65] savevm: Improve error message for blocked migration, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 39/65] nbd: fix the co_queue multi-adding bug, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 42/65] qtest: Fix deadloop by running main loop AIO context's timers,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL v2 44/65] qtest: Add scripts/qtest.py, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 37/65] qtest/ahci: Assert sector size in identify test, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 45/65] qemu-iotests: Add VM method qtest() to iotests.py, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 46/65] qemu-iotests: Allow caller to disable underscore convertion for qmp, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 47/65] qemu-iotests: Add 093 for IO throttling, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 50/65] block: Lift some BDS functions to the BlockBackend, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 49/65] iotests: Add test for qemu-img convert to NBD, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 52/65] block: Add Error parameter to bdrv_find_protocol(), Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 53/65] iotests: Add test for driver=qcow2, format=qcow2, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 48/65] qemu-img: Fix qemu-img convert -n, Stefan Hajnoczi, 2015/02/16