diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-04-19 17:54:56 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-23 14:30:50 +0200 |
commit | bb02b65c7d57e4f2136f39bfba95cc68d89eb216 (patch) | |
tree | 1df5ac17eb38186457e82995d6cccab1e90210f4 /include | |
parent | dbe5e6c1f73b41282624b78a2375a5c3ee59e905 (diff) |
job: Move BlockJobCreateFlags to Job
This renames the BlockJobCreateFlags constants, moves a few JOB_INTERNAL
checks to job_create() and the auto_{finalize,dismiss} fields from
BlockJob to Job.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/blockjob.h | 17 | ||||
-rw-r--r-- | include/block/blockjob_int.h | 3 | ||||
-rw-r--r-- | include/qemu/job.h | 20 |
3 files changed, 20 insertions, 20 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 3e94e18850..f9aaaaa835 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -91,27 +91,10 @@ typedef struct BlockJob { /** ret code passed to block_job_completed. */ int ret; - /** True if this job should automatically finalize itself */ - bool auto_finalize; - - /** True if this job should automatically dismiss itself */ - bool auto_dismiss; - BlockJobTxn *txn; QLIST_ENTRY(BlockJob) txn_list; } BlockJob; -typedef enum BlockJobCreateFlags { - /* Default behavior */ - BLOCK_JOB_DEFAULT = 0x00, - /* BlockJob is not QMP-created and should not send QMP events */ - BLOCK_JOB_INTERNAL = 0x01, - /* BlockJob requires manual finalize step */ - BLOCK_JOB_MANUAL_FINALIZE = 0x02, - /* BlockJob requires manual dismiss step */ - BLOCK_JOB_MANUAL_DISMISS = 0x04, -} BlockJobCreateFlags; - /** * block_job_next: * @job: A block job, or %NULL. diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h index 7e705ae0e9..88639f7efc 100644 --- a/include/block/blockjob_int.h +++ b/include/block/blockjob_int.h @@ -106,8 +106,7 @@ struct BlockJobDriver { * @bs: The block * @perm, @shared_perm: Permissions to request for @bs * @speed: The maximum speed, in bytes per second, or 0 for unlimited. - * @flags: Creation flags for the Block Job. - * See @BlockJobCreateFlags + * @flags: Creation flags for the Block Job. See @JobCreateFlags. * @cb: Completion function for the job. * @opaque: Opaque pointer value passed to @cb. * @errp: Error object. diff --git a/include/qemu/job.h b/include/qemu/job.h index 858f3beea4..9783e4049b 100644 --- a/include/qemu/job.h +++ b/include/qemu/job.h @@ -99,6 +99,12 @@ typedef struct Job { /** Set to true when the job has deferred work to the main loop. */ bool deferred_to_main_loop; + /** True if this job should automatically finalize itself */ + bool auto_finalize; + + /** True if this job should automatically dismiss itself */ + bool auto_dismiss; + /** Element of the list of jobs */ QLIST_ENTRY(Job) job_list; } Job; @@ -140,6 +146,17 @@ struct JobDriver { void (*free)(Job *job); }; +typedef enum JobCreateFlags { + /* Default behavior */ + JOB_DEFAULT = 0x00, + /* Job is not QMP-created and should not send QMP events */ + JOB_INTERNAL = 0x01, + /* Job requires manual finalize step */ + JOB_MANUAL_FINALIZE = 0x02, + /* Job requires manual dismiss step */ + JOB_MANUAL_DISMISS = 0x04, +} JobCreateFlags; + /** * Create a new long-running job and return it. @@ -147,10 +164,11 @@ struct JobDriver { * @job_id: The id of the newly-created job, or %NULL for internal jobs * @driver: The class object for the newly-created job. * @ctx: The AioContext to run the job coroutine in. + * @flags: Creation flags for the job. See @JobCreateFlags. * @errp: Error object. */ void *job_create(const char *job_id, const JobDriver *driver, AioContext *ctx, - Error **errp); + int flags, Error **errp); /** * Add a reference to Job refcnt, it will be decreased with job_unref, and then |