diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-04-23 18:04:57 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-23 14:30:50 +0200 |
commit | 139a9f020d49e9f863e0d46fd3d0b440dfb3b9d7 (patch) | |
tree | 2d38eb4bfd2f2f8beb1b9fdc0ea6180b06e9a092 /include/block/blockjob.h | |
parent | 5d4f376998bc6b01402b90634385b082b2eb5c5b (diff) |
job: Add job_event_*()
Go through the Job layer in order to send QMP events. For the moment,
these functions only call a notifier in the BlockJob layer that sends
the existing commands.
This uses notifiers rather than JobDriver callbacks because internal
users of jobs won't receive QMP events, but might still be interested
in getting notified for the events.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/block/blockjob.h')
-rw-r--r-- | include/block/blockjob.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h index f9aaaaa835..aef06295f6 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -82,6 +82,15 @@ typedef struct BlockJob { /** Block other operations when block job is running */ Error *blocker; + /** Called when a cancelled job is finalised. */ + Notifier finalize_cancelled_notifier; + + /** Called when a successfully completed job is finalised. */ + Notifier finalize_completed_notifier; + + /** Called when the job transitions to PENDING */ + Notifier pending_notifier; + /** BlockDriverStates that are involved in this block job */ GSList *nodes; |