aboutsummaryrefslogtreecommitdiff
path: root/block/iscsi.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/iscsi.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/iscsi.c')
-rw-r--r--block/iscsi.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/block/iscsi.c b/block/iscsi.c
index dff548a139..46ddc355ac 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -95,7 +95,6 @@ typedef struct IscsiTask {
int do_retry;
struct scsi_task *task;
Coroutine *co;
- QEMUBH *bh;
IscsiLun *iscsilun;
QEMUTimer retry_timer;
int err_code;
@@ -167,7 +166,6 @@ static void iscsi_co_generic_bh_cb(void *opaque)
{
struct IscsiTask *iTask = opaque;
iTask->complete = 1;
- qemu_bh_delete(iTask->bh);
qemu_coroutine_enter(iTask->co);
}
@@ -299,9 +297,8 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
out:
if (iTask->co) {
- iTask->bh = aio_bh_new(iTask->iscsilun->aio_context,
- iscsi_co_generic_bh_cb, iTask);
- qemu_bh_schedule(iTask->bh);
+ aio_bh_schedule_oneshot(iTask->iscsilun->aio_context,
+ iscsi_co_generic_bh_cb, iTask);
} else {
iTask->complete = 1;
}