[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [Qemu-devel] [PATCH v2 3/6] test-bdrv-drain: Test Bloc
From: |
Eric Blake |
Subject: |
Re: [Qemu-stable] [Qemu-devel] [PATCH v2 3/6] test-bdrv-drain: Test BlockDriver callbacks for drain |
Date: |
Fri, 8 Dec 2017 09:18:38 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 12/06/2017 04:53 AM, Kevin Wolf wrote:
> This adds a test case that the BlockDriver callbacks for drain are
> called in bdrv_drained_all_begin/end(), and that both of them are called
> exactly once.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> tests/test-bdrv-drain.c | 137
> ++++++++++++++++++++++++++++++++++++++++++++++++
> tests/Makefile.include | 2 +
> 2 files changed, 139 insertions(+)
> create mode 100644 tests/test-bdrv-drain.c
>
> +static int coroutine_fn bdrv_test_co_preadv(BlockDriverState *bs,
> + uint64_t offset, uint64_t bytes,
> + QEMUIOVector *qiov, int flags)
> +{
> + /* We want this request to stay until the polling loop in drain waits for
> + * it to complete. We need to sleep a while as bdrv_drain_invoke() comes
> + * first and polls its result, too, but it shouldn't accidentally
> complete
> + * this request yet. */
> + co_aio_sleep_ns(qemu_get_aio_context(), QEMU_CLOCK_REALTIME, 100000);
> +
Conflicts with patches to remove the first parameter from co_aio_sleep_ns():
https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg01681.html
Should be an obvious fix for whoever rebases on top of the other, so:
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-stable] [PATCH v2 0/6] block: Fix BlockDriver callbacks in bdrv_drain_all_begin(), Kevin Wolf, 2017/12/06
- [Qemu-stable] [PATCH v2 2/6] block: Call .drain_begin only once in bdrv_drain_all_begin(), Kevin Wolf, 2017/12/06
- [Qemu-stable] [PATCH v2 1/6] block: Make bdrv_drain_invoke() recursive, Kevin Wolf, 2017/12/06
- [Qemu-stable] [PATCH v2 4/6] block: bdrv_drain_recurse(): Remove unused begin parameter, Kevin Wolf, 2017/12/06
- [Qemu-stable] [PATCH v2 3/6] test-bdrv-drain: Test BlockDriver callbacks for drain, Kevin Wolf, 2017/12/06
- Re: [Qemu-stable] [Qemu-devel] [PATCH v2 3/6] test-bdrv-drain: Test BlockDriver callbacks for drain,
Eric Blake <=
- [Qemu-stable] [PATCH v2 6/6] block: Unify order in drain functions, Kevin Wolf, 2017/12/06
- [Qemu-stable] [PATCH v2 5/6] block: Don't wait for requests in bdrv_drain*_end(), Kevin Wolf, 2017/12/06
- Re: [Qemu-stable] [Qemu-devel] [PATCH v2 0/6] block: Fix BlockDriver callbacks in bdrv_drain_all_begin(), Stefan Hajnoczi, 2017/12/08
- Re: [Qemu-stable] [PATCH v2 0/6] block: Fix BlockDriver callbacks in bdrv_drain_all_begin(), Kevin Wolf, 2017/12/08