diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2016-06-16 17:56:27 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2016-06-20 14:25:41 +0100 |
commit | 463e0be101cb5a78ca6ee517d58604c3f3637bcd (patch) | |
tree | 9fcee9ddef069c53575c6af45baa52c4490da974 /include | |
parent | e8a095dadb70e2ea6d5169d261920db3747bfa45 (diff) | |
download | qemu-463e0be101cb5a78ca6ee517d58604c3f3637bcd.zip qemu-463e0be101cb5a78ca6ee517d58604c3f3637bcd.tar.gz qemu-463e0be101cb5a78ca6ee517d58604c3f3637bcd.tar.bz2 |
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')
-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 7739f37..7dc720c 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; /** |