summaryrefslogtreecommitdiff
path: root/block/nfs.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-10-03 18:14:16 +0200
committerKevin Wolf <kwolf@redhat.com>2016-10-07 13:34:07 +0200
commitfffb6e12233002c26c0ee9ff92fa87927cd779f2 (patch)
tree58513502dcb4fab664a02eb06b0751f8c8d2e913 /block/nfs.c
parent5b8bb3595a2941e9408021f1080e60ce86d677d2 (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/nfs.c')
-rw-r--r--block/nfs.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/block/nfs.c b/block/nfs.c
index 8602a44211..c3db2ec58d 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -57,7 +57,6 @@ typedef struct NFSRPC {
QEMUIOVector *iov;
struct stat *st;
Coroutine *co;
- QEMUBH *bh;
NFSClient *client;
} NFSRPC;
@@ -103,7 +102,6 @@ static void nfs_co_generic_bh_cb(void *opaque)
{
NFSRPC *task = opaque;
task->complete = 1;
- qemu_bh_delete(task->bh);
qemu_coroutine_enter(task->co);
}
@@ -127,9 +125,8 @@ nfs_co_generic_cb(int ret, struct nfs_context *nfs, void *data,
error_report("NFS Error: %s", nfs_get_error(nfs));
}
if (task->co) {
- task->bh = aio_bh_new(task->client->aio_context,
- nfs_co_generic_bh_cb, task);
- qemu_bh_schedule(task->bh);
+ aio_bh_schedule_oneshot(task->client->aio_context,
+ nfs_co_generic_bh_cb, task);
} else {
task->complete = 1;
}