]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: remove redundant variable from libxlDomainJobObj
authorKristina Hanicova <khanicov@redhat.com>
Mon, 28 Feb 2022 10:49:23 +0000 (11:49 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 1 Mar 2022 10:03:57 +0000 (11:03 +0100)
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>
src/libxl/libxl_domain.c
src/libxl/libxl_domain.h

index ee031267ca74cd456c249f425b9df939d4daff60..205049f98a9ab39194250846e65dba63c2a72e18 100644 (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;
 }
 
index 475e4a693310983b0c44a7cbc064ff2cd77c0a94..157f480b936d28edeab0f2e9136e24ed734c1a1c 100644 (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 */
 };