libxl: remove redundant variable from libxlDomainJobObj
It makes no sense to have 'started' variable in the libxlDomainJobObj as the same one is already in virDomainJobData, but never used. Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
c7b9591ef3
commit
8ce46ec2c3
@ -118,7 +118,7 @@ libxlDomainObjBeginJob(libxlDriverPrivate *driver G_GNUC_UNUSED,
|
|||||||
VIR_DEBUG("Starting job: %s", libxlDomainJobTypeToString(job));
|
VIR_DEBUG("Starting job: %s", libxlDomainJobTypeToString(job));
|
||||||
priv->job.active = job;
|
priv->job.active = job;
|
||||||
priv->job.owner = virThreadSelfID();
|
priv->job.owner = virThreadSelfID();
|
||||||
priv->job.started = now;
|
priv->job.current->started = now;
|
||||||
priv->job.current->jobType = VIR_DOMAIN_JOB_UNBOUNDED;
|
priv->job.current->jobType = VIR_DOMAIN_JOB_UNBOUNDED;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -171,18 +171,18 @@ libxlDomainJobUpdateTime(struct libxlDomainJobObj *job)
|
|||||||
virDomainJobData *jobData = job->current;
|
virDomainJobData *jobData = job->current;
|
||||||
unsigned long long now;
|
unsigned long long now;
|
||||||
|
|
||||||
if (!job->started)
|
if (!jobData->started)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (virTimeMillisNow(&now) < 0)
|
if (virTimeMillisNow(&now) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (now < job->started) {
|
if (now < jobData->started) {
|
||||||
job->started = 0;
|
jobData->started = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
jobData->timeElapsed = now - job->started;
|
jobData->timeElapsed = now - jobData->started;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@ struct libxlDomainJobObj {
|
|||||||
virCond cond; /* Use to coordinate jobs */
|
virCond cond; /* Use to coordinate jobs */
|
||||||
enum libxlDomainJob active; /* Currently running job */
|
enum libxlDomainJob active; /* Currently running job */
|
||||||
int owner; /* Thread which set current job */
|
int owner; /* Thread which set current job */
|
||||||
unsigned long long started; /* When the job started */
|
|
||||||
virDomainJobData *current; /* Statistics for the current job */
|
virDomainJobData *current; /* Statistics for the current job */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user