aboutsummaryrefslogtreecommitdiff
path: root/block/curl.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/curl.c
parent5b8bb3595a2941e9408021f1080e60ce86d677d2 (diff)
downloadqemu-fffb6e12233002c26c0ee9ff92fa87927cd779f2.zip
qemu-fffb6e12233002c26c0ee9ff92fa87927cd779f2.tar.gz
qemu-fffb6e12233002c26c0ee9ff92fa87927cd779f2.tar.bz2
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/curl.c')
-rw-r--r--block/curl.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/block/curl.c b/block/curl.c
index 571f24c..e5eaa7b 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -96,7 +96,6 @@ struct BDRVCURLState;
typedef struct CURLAIOCB {
BlockAIOCB common;
- QEMUBH *bh;
QEMUIOVector *qiov;
int64_t sector_num;
@@ -739,9 +738,6 @@ static void curl_readv_bh_cb(void *p)
CURLAIOCB *acb = p;
BDRVCURLState *s = acb->common.bs->opaque;
- qemu_bh_delete(acb->bh);
- acb->bh = NULL;
-
size_t start = acb->sector_num * SECTOR_SIZE;
size_t end;
@@ -805,8 +801,7 @@ static BlockAIOCB *curl_aio_readv(BlockDriverState *bs,
acb->sector_num = sector_num;
acb->nb_sectors = nb_sectors;
- acb->bh = aio_bh_new(bdrv_get_aio_context(bs), curl_readv_bh_cb, acb);
- qemu_bh_schedule(acb->bh);
+ aio_bh_schedule_oneshot(bdrv_get_aio_context(bs), curl_readv_bh_cb, acb);
return &acb->common;
}