render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
6ae9ed
From e32c0091dd23e91cdaa64929e417fa86770849b8 Mon Sep 17 00:00:00 2001
6ae9ed
Message-Id: <e32c0091dd23e91cdaa64929e417fa86770849b8@dist-git>
6ae9ed
From: Jiri Denemark <jdenemar@redhat.com>
6ae9ed
Date: Mon, 18 Jul 2016 13:17:28 +0200
6ae9ed
Subject: [PATCH] qemu: Fix migration from old libvirt
6ae9ed
6ae9ed
Older libvirt versions send persistent XML in a migration cookie even
6ae9ed
when VIR_MIGRATE_PERSIST_DEST flag is not used, but current libvirt
6ae9ed
properly fails if the cookie contains unexpected flags. Thus migration
6ae9ed
from old libvirt fails with
6ae9ed
6ae9ed
    internal error: Unsupported migration cookie feature persistent
6ae9ed
6ae9ed
unless VIR_MIGRATE_PERSIST_DEST flag is set.
6ae9ed
6ae9ed
https://bugzilla.redhat.com/show_bug.cgi?id=1320500
6ae9ed
6ae9ed
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6ae9ed
(cherry picked from commit 338f772e923ce07148abe6dcaf3d62b744e7baf5)
6ae9ed
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6ae9ed
---
6ae9ed
 src/qemu/qemu_migration.c | 5 +++--
6ae9ed
 1 file changed, 3 insertions(+), 2 deletions(-)
6ae9ed
6ae9ed
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
6ae9ed
index 0b1770b..463e624 100644
6ae9ed
--- a/src/qemu/qemu_migration.c
6ae9ed
+++ b/src/qemu/qemu_migration.c
6ae9ed
@@ -6183,8 +6183,9 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
6ae9ed
     cookie_flags = QEMU_MIGRATION_COOKIE_NETWORK |
6ae9ed
                    QEMU_MIGRATION_COOKIE_STATS |
6ae9ed
                    QEMU_MIGRATION_COOKIE_NBD;
6ae9ed
-    if (flags & VIR_MIGRATE_PERSIST_DEST)
6ae9ed
-        cookie_flags |= QEMU_MIGRATION_COOKIE_PERSISTENT;
6ae9ed
+    /* Some older versions of libvirt always send persistent XML in the cookie
6ae9ed
+     * even though VIR_MIGRATE_PERSIST_DEST was not used. */
6ae9ed
+    cookie_flags |= QEMU_MIGRATION_COOKIE_PERSISTENT;
6ae9ed
 
6ae9ed
     if (!(mig = qemuMigrationEatCookie(driver, vm, cookiein,
6ae9ed
                                        cookieinlen, cookie_flags)))
6ae9ed
-- 
6ae9ed
2.9.2
6ae9ed