diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2017-11-09 10:26:52 +0000 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-12-19 09:25:27 +0000 |
commit | 78f1d3d6a6904459b0b6cfd735278e4e2b7b68c5 (patch) | |
tree | ea95b1b42bc1b9ccd6b4ae549fd478c812ffc6da /block | |
parent | eaefea537b476cb853e2edbdc68e969ec777e4bb (diff) | |
download | qemu-78f1d3d6a6904459b0b6cfd735278e4e2b7b68c5.zip qemu-78f1d3d6a6904459b0b6cfd735278e4e2b7b68c5.tar.gz qemu-78f1d3d6a6904459b0b6cfd735278e4e2b7b68c5.tar.bz2 |
coroutine: simplify co_aio_sleep_ns() prototype
The AioContext pointer argument to co_aio_sleep_ns() is only used for
the sleep timer. It does not affect where the caller coroutine is
resumed.
Due to changes to coroutine and AIO APIs it is now possible to drop the
AioContext pointer argument. This is safe to do since no caller has
specific requirements for which AioContext the timer must run in.
This patch drops the AioContext pointer argument and renames the
function to simplify the API.
Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171109102652.6360-1-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/null.c | 3 | ||||
-rw-r--r-- | block/sheepdog.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/block/null.c b/block/null.c index dd9c13f..0cdabaa 100644 --- a/block/null.c +++ b/block/null.c @@ -110,8 +110,7 @@ static coroutine_fn int null_co_common(BlockDriverState *bs) BDRVNullState *s = bs->opaque; if (s->latency_ns) { - co_aio_sleep_ns(bdrv_get_aio_context(bs), QEMU_CLOCK_REALTIME, - s->latency_ns); + qemu_co_sleep_ns(QEMU_CLOCK_REALTIME, s->latency_ns); } return 0; } diff --git a/block/sheepdog.c b/block/sheepdog.c index 696a714..a1edb99 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -776,8 +776,7 @@ static coroutine_fn void reconnect_to_sdog(void *opaque) if (s->fd < 0) { DPRINTF("Wait for connection to be established\n"); error_report_err(local_err); - co_aio_sleep_ns(bdrv_get_aio_context(s->bs), QEMU_CLOCK_REALTIME, - 1000000000ULL); + qemu_co_sleep_ns(QEMU_CLOCK_REALTIME, 1000000000ULL); } }; |