diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-10-03 18:14:16 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-10-07 13:34:07 +0200 |
commit | fffb6e12233002c26c0ee9ff92fa87927cd779f2 (patch) | |
tree | 58513502dcb4fab664a02eb06b0751f8c8d2e913 /block/archipelago.c | |
parent | 5b8bb3595a2941e9408021f1080e60ce86d677d2 (diff) |
block: use aio_bh_schedule_oneshot
This simplifies bottom half handlers by removing calls to qemu_bh_delete and
thus removing the need to stash the bottom half pointer in the opaque
datum.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/archipelago.c')
-rw-r--r-- | block/archipelago.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/block/archipelago.c b/block/archipelago.c index 37b8aca78d..2449cfc702 100644 --- a/block/archipelago.c +++ b/block/archipelago.c @@ -87,7 +87,6 @@ typedef enum { typedef struct ArchipelagoAIOCB { BlockAIOCB common; - QEMUBH *bh; struct BDRVArchipelagoState *s; QEMUIOVector *qiov; ARCHIPCmd cmd; @@ -154,11 +153,10 @@ static void archipelago_finish_aiocb(AIORequestData *reqdata) } else if (reqdata->aio_cb->ret == reqdata->segreq->total) { reqdata->aio_cb->ret = 0; } - reqdata->aio_cb->bh = aio_bh_new( + aio_bh_schedule_oneshot( bdrv_get_aio_context(reqdata->aio_cb->common.bs), qemu_archipelago_complete_aio, reqdata ); - qemu_bh_schedule(reqdata->aio_cb->bh); } static int wait_reply(struct xseg *xseg, xport srcport, struct xseg_port *port, @@ -313,7 +311,6 @@ static void qemu_archipelago_complete_aio(void *opaque) AIORequestData *reqdata = (AIORequestData *) opaque; ArchipelagoAIOCB *aio_cb = (ArchipelagoAIOCB *) reqdata->aio_cb; - qemu_bh_delete(aio_cb->bh); aio_cb->common.cb(aio_cb->common.opaque, aio_cb->ret); aio_cb->status = 0; |