diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/block/blockjob.h | 3 | ||||
-rw-r--r-- | include/qemu/job.h | 13 |
2 files changed, 13 insertions, 3 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 10bd9f7059..01cdee6d15 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -147,9 +147,6 @@ typedef struct BlockJob { */ QEMUTimer sleep_timer; - /** Current state; See @BlockJobStatus for details. */ - BlockJobStatus status; - /** True if this job should automatically finalize itself */ bool auto_finalize; diff --git a/include/qemu/job.h b/include/qemu/job.h index bae2b0920c..0b78778b9e 100644 --- a/include/qemu/job.h +++ b/include/qemu/job.h @@ -41,6 +41,9 @@ typedef struct Job { /** The type of this job. */ const JobDriver *driver; + /** Current state; See @JobStatus for details. */ + JobStatus status; + /** Element of the list of jobs */ QLIST_ENTRY(Job) job_list; } Job; @@ -90,4 +93,14 @@ Job *job_next(Job *job); */ Job *job_get(const char *id); +/** + * Check whether the verb @verb can be applied to @job in its current state. + * Returns 0 if the verb can be applied; otherwise errp is set and -EPERM + * returned. + */ +int job_apply_verb(Job *job, JobVerb verb, Error **errp); + +/* TODO To be removed from the public interface */ +void job_state_transition(Job *job, JobStatus s1); + #endif |