mirror of
https://github.com/mborgerson/xemu.git
synced 2025-12-01 16:10:01 +00:00
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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user