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:
Kevin Wolf
2018-04-12 17:57:08 +02:00
parent 8e4c87000f
commit 252291eaea
8 changed files with 33 additions and 17 deletions

View File

@ -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