diff options
| author | Stefan Hajnoczi | 2016-06-16 18:56:27 +0200 |
|---|---|---|
| committer | Stefan Hajnoczi | 2016-06-20 15:25:41 +0200 |
| commit | 463e0be101cb5a78ca6ee517d58604c3f3637bcd (patch) | |
| tree | 9fcee9ddef069c53575c6af45baa52c4490da974 /include/block | |
| parent | block: use safe iteration over AioContext notifiers (diff) | |
| download | qemu-463e0be101cb5a78ca6ee517d58604c3f3637bcd.tar.gz qemu-463e0be101cb5a78ca6ee517d58604c3f3637bcd.tar.xz qemu-463e0be101cb5a78ca6ee517d58604c3f3637bcd.zip | |
blockjob: add AioContext attached callback
Block jobs that use additional BDSes or event loop resources need a
callback to get their affairs in order when the AioContext is switched.
Simple block jobs don't need an attach callback, they automatically work
thanks to the generic attach/detach notifiers that this patch adds.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1466096189-6477-7-git-send-email-stefanha@redhat.com
Diffstat (limited to 'include/block')
| -rw-r--r-- | include/block/blockjob.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 7739f37c3a..7dc720c82b 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -84,6 +84,13 @@ typedef struct BlockJobDriver { * should be restarted from this callback. */ void coroutine_fn (*resume)(BlockJob *job); + + /* + * If the callback is not NULL, it will be invoked before the job is + * resumed in a new AioContext. This is the place to move any resources + * besides job->blk to the new AioContext. + */ + void (*attached_aio_context)(BlockJob *job, AioContext *new_context); } BlockJobDriver; /** |
