render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 8c0140804b2ec68878f1028dfd193e8f4484d49b Mon Sep 17 00:00:00 2001
Message-Id: <8c0140804b2ec68878f1028dfd193e8f4484d49b.1390394206.git.jdenemar@redhat.com>
From: Michael Avdienko <whitearchey@gmail.com>
Date: Mon, 20 Jan 2014 15:21:24 +0100
Subject: [PATCH] Fix migration with QEMU 1.6

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

QEMU 1.6.0 introduced new migration status: setup
Libvirt does not expect such string in QMP and refuses to migrate with error
"unexpected migration status in setup"

This patch fixes it.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit d35ae4143d11f45856ae002fcd419da0eb9bba9f)
---
 src/qemu/qemu_migration.c | 4 ++++
 src/qemu/qemu_monitor.c   | 2 +-
 src/qemu/qemu_monitor.h   | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index a598d5e..8fd3c9e 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1647,6 +1647,10 @@ qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver,
                        _("%s: %s"), job, _("is not active"));
         break;
 
+    case QEMU_MONITOR_MIGRATION_STATUS_SETUP:
+        ret = 0;
+        break;
+
     case QEMU_MONITOR_MIGRATION_STATUS_ACTIVE:
         priv->job.info.fileTotal = priv->job.status.disk_total;
         priv->job.info.fileRemaining = priv->job.status.disk_remaining;
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 46b6d1a..6df494a 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -113,7 +113,7 @@ VIR_ONCE_GLOBAL_INIT(qemuMonitor)
 
 VIR_ENUM_IMPL(qemuMonitorMigrationStatus,
               QEMU_MONITOR_MIGRATION_STATUS_LAST,
-              "inactive", "active", "completed", "failed", "cancelled")
+              "inactive", "active", "completed", "failed", "cancelled", "setup")
 
 VIR_ENUM_IMPL(qemuMonitorMigrationCaps,
               QEMU_MONITOR_MIGRATION_CAPS_LAST,
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index c694e1c..dec1bcc 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -353,6 +353,7 @@ enum {
     QEMU_MONITOR_MIGRATION_STATUS_COMPLETED,
     QEMU_MONITOR_MIGRATION_STATUS_ERROR,
     QEMU_MONITOR_MIGRATION_STATUS_CANCELLED,
+    QEMU_MONITOR_MIGRATION_STATUS_SETUP,
 
     QEMU_MONITOR_MIGRATION_STATUS_LAST
 };
-- 
1.8.5.3