render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From c92e3fa956308c0b8be42a412b6f6ea2b9ff27ce Mon Sep 17 00:00:00 2001
Message-Id: <c92e3fa956308c0b8be42a412b6f6ea2b9ff27ce@dist-git>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Fri, 19 Jan 2018 13:51:51 +0100
Subject: [PATCH] RHEL: qemu: Report full stats for completed migration

RHEL-only: caused by improper adjustment of a backported patch

When backporting patches (specifically upstream commit 3f2d6d829e, which
was backported to 7.4.z as commit 547c0e17e6) for BZ 1530130 I
intentionally skipped several refactoring commits because they were not
trivial and resolving conflicts could cause more problems than skipping
them. The commits were done upstream to support reporting statistics
from NBD migration.

The refactors moved qemuMigrationFetchJobStatus (hidden in
qemuMigrationUpdateJobStatus in RHEL-7.4) out of
qemuMigrationCheckJobStatus. Because of this, the upstream version of
qemuMigrationCheckJobStatus didn't have to do anything special for the
QEMU_DOMAIN_JOB_STATUS_COMPLETED switch branch. But downstream called
qemuMigrationUpdateJobStatus in this branch and thus
QEMU_DOMAIN_JOB_STATUS_COMPLETED should have been replaced with
QEMU_DOMAIN_JOB_STATUS_QEMU_COMPLETED to make sure the migration
statistics are properly fetched from QEMU once migration completes.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_migration.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 2b1e8dd9fd..ab5398f5ea 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1452,7 +1452,7 @@ qemuMigrationCheckJobStatus(virQEMUDriverPtr driver,
                        qemuMigrationJobName(vm), _("canceled by client"));
         return -1;
 
-    case QEMU_DOMAIN_JOB_STATUS_COMPLETED:
+    case QEMU_DOMAIN_JOB_STATUS_QEMU_COMPLETED:
         /* Fetch statistics of a completed migration */
         if (events && updateJobStats &&
             qemuMigrationUpdateJobStatus(driver, vm, asyncJob) < 0)
@@ -1461,7 +1461,7 @@ qemuMigrationCheckJobStatus(virQEMUDriverPtr driver,
 
     case QEMU_DOMAIN_JOB_STATUS_ACTIVE:
     case QEMU_DOMAIN_JOB_STATUS_MIGRATING:
-    case QEMU_DOMAIN_JOB_STATUS_QEMU_COMPLETED:
+    case QEMU_DOMAIN_JOB_STATUS_COMPLETED:
     case QEMU_DOMAIN_JOB_STATUS_POSTCOPY:
         break;
     }
-- 
2.16.0