[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/38] block: allow interrupting a co_sleep_ns
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 11/38] block: allow interrupting a co_sleep_ns |
Date: |
Fri, 20 Apr 2012 19:01:17 +0200 |
From: Paolo Bonzini <address@hidden>
In the next patch we want to reenter the coroutine from
block_job_cancel_sync and cancel the timer.
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
qemu-coroutine-sleep.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/qemu-coroutine-sleep.c b/qemu-coroutine-sleep.c
index fd65274..d7083ee 100644
--- a/qemu-coroutine-sleep.c
+++ b/qemu-coroutine-sleep.c
@@ -23,7 +23,6 @@ static void co_sleep_cb(void *opaque)
{
CoSleepCB *sleep_cb = opaque;
- qemu_free_timer(sleep_cb->ts);
qemu_coroutine_enter(sleep_cb->co, NULL);
}
@@ -35,4 +34,6 @@ void coroutine_fn co_sleep_ns(QEMUClock *clock, int64_t ns)
sleep_cb.ts = qemu_new_timer(clock, SCALE_NS, co_sleep_cb, &sleep_cb);
qemu_mod_timer(sleep_cb.ts, qemu_get_clock_ns(clock) + ns);
qemu_coroutine_yield();
+ qemu_del_timer(sleep_cb.ts);
+ qemu_free_timer(sleep_cb.ts);
}
--
1.7.6.5
- [Qemu-devel] [PATCH 02/38] qemu-iotests: Test bdrv_close while AIO is in flight, (continued)
- [Qemu-devel] [PATCH 02/38] qemu-iotests: Test bdrv_close while AIO is in flight, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 01/38] qemu-iotests: Always filter cluster_size out in _make_test_img, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 06/38] qemu-io: Add command line switch for cache mode, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 05/38] block: Fix spelling in comment (ineffcient -> inefficient), Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 04/38] iotests: fix error in 005, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 07/38] ide: convert ide_sector_read() to asynchronous I/O, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 10/38] qcow2: Fix return value of alloc_refcount_block, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 09/38] qcow2: Fix error handling in qcow2_alloc_cluster_offset, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 08/38] ide: convert ide_sector_write() to asynchronous I/O, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 13/38] qemu-tool: map vm_clock to rt_clock, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 11/38] block: allow interrupting a co_sleep_ns,
Kevin Wolf <=
- [Qemu-devel] [PATCH 17/38] aio: simplify qemu_aio_wait, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 14/38] posix-aio: merge posix_aio_process_queue and posix_aio_read, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 16/38] aio: return "AIO in progress" state from qemu_aio_wait, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 18/38] qemu-img: let 'qemu-img convert' flush data, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 19/38] iotests: Resolve test failures caused by hostname, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 15/38] aio: remove process_queue callback and qemu_aio_process_queue, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 20/38] qcow2: Fix refcount block allocation during qcow2_alloc_cluster_at(), Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 22/38] qcow2: Save disk size in snapshot header, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 25/38] qcow2: Fail write_compressed when overwriting data, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 27/38] qcow2: Refactor qcow2_free_any_clusters, Kevin Wolf, 2012/04/20