404507
From 267d4074f4c6a543643e1fe8cd726953273a5bc6 Mon Sep 17 00:00:00 2001
404507
Message-Id: <267d4074f4c6a543643e1fe8cd726953273a5bc6@dist-git>
404507
From: Jiri Denemark <jdenemar@redhat.com>
404507
Date: Wed, 10 Jan 2018 15:56:21 +0100
404507
Subject: [PATCH] qemu: Ignore fallback CPU attribute on reconnect
404507
404507
When reconnecting to a running domain with host-model CPU started by old
404507
libvirt which did not store the actual CPU in the status XML, we need to
404507
ignore the fallback attribute to make sure we can translate the detected
404507
host CPU model to a model which is supported by the running QEMU.
404507
404507
https://bugzilla.redhat.com/show_bug.cgi?id=1532980
404507
404507
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
404507
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
404507
(cherry picked from commit 237f045d9a9d84a52e645b490d14ad0b66e5b8ed)
404507
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
404507
---
404507
 src/qemu/qemu_process.c | 5 +++++
404507
 1 file changed, 5 insertions(+)
404507
404507
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
404507
index 701528c42c..c64088e4ca 100644
404507
--- a/src/qemu/qemu_process.c
404507
+++ b/src/qemu/qemu_process.c
404507
@@ -3884,6 +3884,11 @@ qemuProcessUpdateCPU(virQEMUDriverPtr driver,
404507
     virDomainCapsCPUModelsPtr models = NULL;
404507
     int ret = -1;
404507
 
404507
+    /* The host CPU model comes from host caps rather than QEMU caps so
404507
+     * fallback must be allowed no matter what the user specified in the XML.
404507
+     */
404507
+    vm->def->cpu->fallback = VIR_CPU_FALLBACK_ALLOW;
404507
+
404507
     if (qemuProcessFetchGuestCPU(driver, vm, asyncJob, &cpu, &disabled) < 0)
404507
         goto cleanup;
404507
 
404507
-- 
404507
2.15.1
404507