libxl: use virDomainJobObj

This patch replaces struct libxlDomainJobObj with generalized
virDomainJobObj.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Kristina Hanicova 2022-07-19 15:48:23 +02:00 committed by Michal Privoznik
parent fb2fdba2f0
commit c228910d26
2 changed files with 5 additions and 12 deletions

View File

@ -60,7 +60,7 @@ libxlDomainObjInitJob(libxlDomainObjPrivate *priv)
static void static void
libxlDomainObjResetJob(libxlDomainObjPrivate *priv) libxlDomainObjResetJob(libxlDomainObjPrivate *priv)
{ {
struct libxlDomainJobObj *job = &priv->job; virDomainJobObj *job = &priv->job;
job->active = VIR_JOB_NONE; job->active = VIR_JOB_NONE;
job->owner = 0; job->owner = 0;
@ -117,7 +117,7 @@ libxlDomainObjBeginJob(libxlDriverPrivate *driver G_GNUC_UNUSED,
error: error:
VIR_WARN("Cannot start job (%s) for domain %s;" VIR_WARN("Cannot start job (%s) for domain %s;"
" current job is (%s) owned by (%d)", " current job is (%s) owned by (%llu)",
virDomainJobTypeToString(job), virDomainJobTypeToString(job),
obj->def->name, obj->def->name,
virDomainJobTypeToString(priv->job.active), virDomainJobTypeToString(priv->job.active),
@ -158,7 +158,7 @@ libxlDomainObjEndJob(libxlDriverPrivate *driver G_GNUC_UNUSED,
} }
int int
libxlDomainJobUpdateTime(struct libxlDomainJobObj *job) libxlDomainJobUpdateTime(virDomainJobObj *job)
{ {
virDomainJobData *jobData = job->current; virDomainJobData *jobData = job->current;
unsigned long long now; unsigned long long now;

View File

@ -27,13 +27,6 @@
#include "domain_job.h" #include "domain_job.h"
struct libxlDomainJobObj {
virCond cond; /* Use to coordinate jobs */
virDomainJob active; /* Currently running job */
int owner; /* Thread which set current job */
virDomainJobData *current; /* Statistics for the current job */
};
typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate; typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate;
struct _libxlDomainObjPrivate { struct _libxlDomainObjPrivate {
/* console */ /* console */
@ -44,7 +37,7 @@ struct _libxlDomainObjPrivate {
char *lockState; char *lockState;
bool lockProcessRunning; bool lockProcessRunning;
struct libxlDomainJobObj job; virDomainJobObj job;
bool hookRun; /* true if there was a hook run over this domain */ bool hookRun; /* true if there was a hook run over this domain */
}; };
@ -69,7 +62,7 @@ libxlDomainObjEndJob(libxlDriverPrivate *driver,
virDomainObj *obj); virDomainObj *obj);
int int
libxlDomainJobUpdateTime(struct libxlDomainJobObj *job) libxlDomainJobUpdateTime(virDomainJobObj *job)
G_GNUC_WARN_UNUSED_RESULT; G_GNUC_WARN_UNUSED_RESULT;
char * char *