On Thu, Jan 12, 2012 at 10:13 AM, Kevin Wolf <kw...@redhat.com> wrote: > Am 06.01.2012 15:01, schrieb Stefan Hajnoczi: >> Signed-off-by: Stefan Hajnoczi <stefa...@linux.vnet.ibm.com> >> --- >> Makefile.objs | 1 + >> qemu-coroutine-sleep.c | 38 ++++++++++++++++++++++++++++++++++++++ >> qemu-coroutine.h | 6 ++++++ >> 3 files changed, 45 insertions(+), 0 deletions(-) >> create mode 100644 qemu-coroutine-sleep.c > >> diff --git a/qemu-coroutine.h b/qemu-coroutine.h >> index 8a55fe1..bae1ffe 100644 >> --- a/qemu-coroutine.h >> +++ b/qemu-coroutine.h >> @@ -17,6 +17,7 @@ >> >> #include <stdbool.h> >> #include "qemu-queue.h" >> +#include "qemu-timer.h" >> >> /** >> * Coroutines are a mechanism for stack switching and can be used for >> @@ -199,4 +200,9 @@ void qemu_co_rwlock_wrlock(CoRwlock *lock); >> */ >> void qemu_co_rwlock_unlock(CoRwlock *lock); >> >> +/** >> + * Yield the coroutine for a given duration >> + */ >> +void coroutine_fn co_sleep_ns(QEMUClock *clock, int64_t ns); >> + >> #endif /* QEMU_COROUTINE_H */ > > As you mentioned on IRC yesterday, timers don't work in the tools. There > should probably be a warning in the comment (or a fix before this is merged)
I will add a comment to prevent new callers using this inappropriately. qemu-img/qemu-io do not use image streaming so we never hit an abort(3). But I still have an interest in solving the larger problem because QED broken in qemu-tools! So I'll look into using the main loop in qemu-io/qemu-img based on Paolo's patches independently of this image streaming series. Stefan