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:
Kristina Hanicova 2022-02-28 11:49:23 +01:00 committed by Michal Privoznik
parent c7b9591ef3
commit 8ce46ec2c3
2 changed files with 5 additions and 6 deletions

View File

@ -118,7 +118,7 @@ libxlDomainObjBeginJob(libxlDriverPrivate *driver G_GNUC_UNUSED,
VIR_DEBUG("Starting job: %s", libxlDomainJobTypeToString(job));
priv->job.active = job;
priv->job.owner = virThreadSelfID();
priv->job.started = now;
priv->job.current->started = now;
priv->job.current->jobType = VIR_DOMAIN_JOB_UNBOUNDED;
return 0;
@ -171,18 +171,18 @@ libxlDomainJobUpdateTime(struct libxlDomainJobObj *job)
virDomainJobData *jobData = job->current;
unsigned long long now;
if (!job->started)
if (!jobData->started)
return 0;
if (virTimeMillisNow(&now) < 0)
return -1;
if (now < job->started) {
job->started = 0;
if (now < jobData->started) {
jobData->started = 0;
return 0;
}
jobData->timeElapsed = now - job->started;
jobData->timeElapsed = now - jobData->started;
return 0;
}

View File

@ -46,7 +46,6 @@ struct libxlDomainJobObj {
virCond cond; /* Use to coordinate jobs */
enum libxlDomainJob active; /* Currently running job */
int owner; /* Thread which set current job */
unsigned long long started; /* When the job started */
virDomainJobData *current; /* Statistics for the current job */
};