render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 5e9305c83e7acf31e849af2db6b82c7651114425 Mon Sep 17 00:00:00 2001
Message-Id: <5e9305c83e7acf31e849af2db6b82c7651114425@dist-git>
From: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Date: Fri, 1 Sep 2017 09:49:19 +0300
Subject: [PATCH] qemu: drop code for VIR_DOMAIN_JOB_BOUNDED and timeRemaining

qemu driver does not have VIR_DOMAIN_JOB_BOUNDED jobs and
timeRemaining is always 0.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 16bf7619b8377b21e8cb2af33b53949ff77755c6)

https://bugzilla.redhat.com/show_bug.cgi?id=1530130

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_domain.c           | 7 -------
 src/qemu/qemu_domain.h           | 1 -
 src/qemu/qemu_driver.c           | 3 +--
 src/qemu/qemu_migration_cookie.c | 5 -----
 4 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ade06f07db..3c2368368f 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -395,7 +395,6 @@ qemuDomainJobInfoToInfo(qemuDomainJobInfoPtr jobInfo,
 {
     info->type = jobInfo->type;
     info->timeElapsed = jobInfo->timeElapsed;
-    info->timeRemaining = jobInfo->timeRemaining;
 
     info->memTotal = jobInfo->stats.ram_total;
     info->memRemaining = jobInfo->stats.ram_remaining;
@@ -440,12 +439,6 @@ qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo,
                                 jobInfo->timeElapsed - jobInfo->timeDelta) < 0)
         goto error;
 
-    if (jobInfo->type == VIR_DOMAIN_JOB_BOUNDED &&
-        virTypedParamsAddULLong(&par, &npar, &maxpar,
-                                VIR_DOMAIN_JOB_TIME_REMAINING,
-                                jobInfo->timeRemaining) < 0)
-        goto error;
-
     if (stats->downtime_set &&
         virTypedParamsAddULLong(&par, &npar, &maxpar,
                                 VIR_DOMAIN_JOB_DOWNTIME,
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 68458ad9ae..7002407218 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -112,7 +112,6 @@ struct _qemuDomainJobInfo {
                                     info from the source (migrations only). */
     /* Computed values */
     unsigned long long timeElapsed;
-    unsigned long long timeRemaining;
     long long timeDelta; /* delta = received - sent, i.e., the difference
                             between the source and the destination time plus
                             the time between the end of Perform phase on the
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 501f19fbcc..1c60d533e8 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12971,8 +12971,7 @@ qemuDomainGetJobStatsInternal(virQEMUDriverPtr driver,
     }
     *jobInfo = *info;
 
-    if (jobInfo->type == VIR_DOMAIN_JOB_BOUNDED ||
-        jobInfo->type == VIR_DOMAIN_JOB_UNBOUNDED) {
+    if (jobInfo->type == VIR_DOMAIN_JOB_UNBOUNDED) {
         if (fetch)
             ret = qemuMigrationFetchJobStatus(driver, vm, QEMU_ASYNC_JOB_NONE,
                                               jobInfo);
diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index af0ac03418..5f8595fdba 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -612,9 +612,6 @@ qemuMigrationCookieStatisticsXMLFormat(virBufferPtr buf,
     virBufferAsprintf(buf, "<%1$s>%2$llu</%1$s>\n",
                       VIR_DOMAIN_JOB_TIME_ELAPSED,
                       jobInfo->timeElapsed);
-    virBufferAsprintf(buf, "<%1$s>%2$llu</%1$s>\n",
-                      VIR_DOMAIN_JOB_TIME_REMAINING,
-                      jobInfo->timeRemaining);
     if (stats->downtime_set)
         virBufferAsprintf(buf, "<%1$s>%2$llu</%1$s>\n",
                           VIR_DOMAIN_JOB_DOWNTIME,
@@ -987,8 +984,6 @@ qemuMigrationCookieStatisticsXMLParse(xmlXPathContextPtr ctxt)
 
     virXPathULongLong("string(./" VIR_DOMAIN_JOB_TIME_ELAPSED "[1])",
                       ctxt, &jobInfo->timeElapsed);
-    virXPathULongLong("string(./" VIR_DOMAIN_JOB_TIME_REMAINING "[1])",
-                      ctxt, &jobInfo->timeRemaining);
 
     if (virXPathULongLong("string(./" VIR_DOMAIN_JOB_DOWNTIME "[1])",
                           ctxt, &stats->downtime) == 0)
-- 
2.15.1