[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 01/15] coroutine: add co_sleep_ns() coroutine
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v4 01/15] coroutine: add co_sleep_ns() coroutine sleep function |
Date: |
Thu, 12 Jan 2012 10:58:27 +0000 |
On Thu, Jan 12, 2012 at 10:13 AM, Kevin Wolf <address@hidden> wrote:
> Am 06.01.2012 15:01, schrieb Stefan Hajnoczi:
>> Signed-off-by: Stefan Hajnoczi <address@hidden>
>> ---
>> 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)
This is something I'm looking at right now and will probably want to
discuss with Paolo.
In a coroutine we're probably using a main loop and timers should be
available there. In general, the problem we're starting to see is
that some block layer features are using timers (I/O throttling, QED
deferred dirty bit clearing, image streaming). The question is do we
isolate this functionality so it is unavailable from a qemu-tool world
when there's no main loop, or do we move everything into a main loop?
Stefan
- [Qemu-devel] [PATCH v4 10/15] blockdev: make image streaming safe across hotplug, (continued)
- [Qemu-devel] [PATCH v4 10/15] blockdev: make image streaming safe across hotplug, Stefan Hajnoczi, 2012/01/06
- [Qemu-devel] [PATCH v4 05/15] block: rate-limit streaming operations, Stefan Hajnoczi, 2012/01/06
- [Qemu-devel] [PATCH v4 09/15] qmp: add query-block-jobs, Stefan Hajnoczi, 2012/01/06
- [Qemu-devel] [PATCH v4 08/15] qmp: add block_job_cancel command, Stefan Hajnoczi, 2012/01/06
- [Qemu-devel] [PATCH v4 12/15] add QERR_BASE_ID_NOT_FOUND, Stefan Hajnoczi, 2012/01/06
- [Qemu-devel] [PATCH v4 11/15] block: add bdrv_find_backing_image, Stefan Hajnoczi, 2012/01/06
- [Qemu-devel] [PATCH v4 01/15] coroutine: add co_sleep_ns() coroutine sleep function, Stefan Hajnoczi, 2012/01/06
- [Qemu-devel] [PATCH v4 15/15] test: add image streaming test cases, Stefan Hajnoczi, 2012/01/06
- [Qemu-devel] [PATCH v4 13/15] block stream: add support for partial streaming, Stefan Hajnoczi, 2012/01/06
- [Qemu-devel] [PATCH v4 14/15] add doc to describe live block operations, Stefan Hajnoczi, 2012/01/06
- Re: [Qemu-devel] [PATCH v4 00/15] block: generic image streaming, Luiz Capitulino, 2012/01/11