[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] use timer for adding latency to each block I/O
From: |
Huaicheng Li |
Subject: |
Re: [Qemu-devel] use timer for adding latency to each block I/O |
Date: |
Thu, 26 May 2016 13:48:46 -0500 |
> On May 16, 2016, at 11:33 AM, Stefan Hajnoczi <address@hidden> wrote:
>
> The way it's done in the "null" block driver is:
>
> 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);
> }
> return 0;
> }
Thanks so much, Stefan! It seems this is what I need.
Best,