[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] blkdebug: Implement bdrv_co_preadv/pwritev/flus
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] blkdebug: Implement bdrv_co_preadv/pwritev/flush |
Date: |
Tue, 22 Nov 2016 06:59:41 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 11/22/2016 06:39 AM, Kevin Wolf wrote:
> This enables byte granularity requests for blkdebug, and at the same
> time gets us rid of another user of the BDS-level AIO emulation.
>
> Note that unless align=512 is specified, this can behave subtly
> different from the old behaviour because bdrv_co_preadv/pwritev don't
> have to perform alignment adjustments any more.
I'm a little bit surprised that you didn't have to adjust any of the
qemu-iotests to add in align=512.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> block/blkdebug.c | 82
> +++++++++++++++++++++++++++-----------------------------
> 1 file changed, 40 insertions(+), 42 deletions(-)
> @@ -426,81 +426,79 @@ static BlockAIOCB *inject_error(BlockDriverState *bs,
> remove_rule(rule);
> }
>
> - if (immediately) {
> - return NULL;
> + if (!immediately) {
> + aio_bh_schedule_oneshot(bdrv_get_aio_context(bs), error_callback_bh,
> + qemu_coroutine_self());
> + qemu_coroutine_yield();
> }
>
> - acb = qemu_aio_get(&blkdebug_aiocb_info, bs, cb, opaque);
Squash this in to silence gcc's warning about a now-unused variable:
diff --git a/block/blkdebug.c b/block/blkdebug.c
index 0703ec7..acccf85 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -58,10 +58,6 @@ typedef struct BlkdebugSuspendedReq {
QLIST_ENTRY(BlkdebugSuspendedReq) next;
} BlkdebugSuspendedReq;
-static const AIOCBInfo blkdebug_aiocb_info = {
- .aiocb_size = sizeof(BlkdebugAIOCB),
-};
-
enum {
ACTION_INJECT_ERROR,
ACTION_SET_STATE,
at which point you can have:
Reviewed-by: Eric Blake <address@hidden>
(And now I can post my v3 blkdebug patches that have been rebased on top
of this)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature