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>
This commit is contained in:
parent
8e4c87000f
commit
252291eaea
8 changed files with 33 additions and 17 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue