diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-04-12 17:57:08 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-05-23 14:30:49 +0200 |
commit | 252291eaeafcd234a602d71cdf9415dbfc7bc867 (patch) | |
tree | da2af639f71ecd9d28e601b4c1b2ae73435896a8 /include | |
parent | 8e4c87000fc515f8f65f7c8f18afb1e9270b11d6 (diff) |
job: Add JobDriver.job_type
This moves the job_type field from BlockJobDriver to JobDriver.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/blockjob_int.h | 3 | ||||
-rw-r--r-- | include/qemu/job.h | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h index 8e7e0a2f57..1e62d6dd30 100644 --- a/include/block/blockjob_int.h +++ b/include/block/blockjob_int.h @@ -38,9 +38,6 @@ struct BlockJobDriver { /** Generic JobDriver callbacks and settings */ JobDriver job_driver; - /** String describing the operation, part of query-block-jobs QMP API */ - JobType job_type; - /** Mandatory: Entrypoint for the Coroutine. */ CoroutineEntry *start; diff --git a/include/qemu/job.h b/include/qemu/job.h index b4b49f19e1..279ce688fd 100644 --- a/include/qemu/job.h +++ b/include/qemu/job.h @@ -26,6 +26,8 @@ #ifndef JOB_H #define JOB_H +#include "qapi/qapi-types-block-core.h" + typedef struct JobDriver JobDriver; /** @@ -45,6 +47,9 @@ typedef struct Job { struct JobDriver { /** Derived Job struct size */ size_t instance_size; + + /** Enum describing the operation */ + JobType job_type; }; @@ -57,4 +62,10 @@ struct JobDriver { */ void *job_create(const char *job_id, const JobDriver *driver, Error **errp); +/** Returns the JobType of a given Job. */ +JobType job_type(const Job *job); + +/** Returns the enum string for the JobType of a given Job. */ +const char *job_type_str(const Job *job); + #endif |