]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Ignore fallback CPU attribute on reconnect
authorJiri Denemark <jdenemar@redhat.com>
Wed, 10 Jan 2018 14:56:21 +0000 (15:56 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 12 Jan 2018 09:45:31 +0000 (10:45 +0100)
When reconnecting to a running domain with host-model CPU started by old
libvirt which did not store the actual CPU in the status XML, we need to
ignore the fallback attribute to make sure we can translate the detected
host CPU model to a model which is supported by the running QEMU.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_process.c

index 1a0923af36f2f96813b4fb8f85e01a3d04259505..25ec464d3e1c5f0514cc504179339d6aef360f00 100644 (file)
@@ -3887,6 +3887,11 @@ qemuProcessUpdateCPU(virQEMUDriverPtr driver,
     virDomainCapsCPUModelsPtr models = NULL;
     int ret = -1;
 
+    /* The host CPU model comes from host caps rather than QEMU caps so
+     * fallback must be allowed no matter what the user specified in the XML.
+     */
+    vm->def->cpu->fallback = VIR_CPU_FALLBACK_ALLOW;
+
     if (qemuProcessFetchGuestCPU(driver, vm, asyncJob, &cpu, &disabled) < 0)
         goto cleanup;