[libvirt] [PATCH] qemu: Ignore fallback CPU attribute on reconnect

Jiri Denemark posted 1 patch 6 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/009756f28beaf9763702d5ce2ba0973d979e9e47.1515663004.git.jdenemar@redhat.com
src/qemu/qemu_process.c | 5 +++++
1 file changed, 5 insertions(+)
[libvirt] [PATCH] qemu: Ignore fallback CPU attribute on reconnect
Posted by Jiri Denemark 6 years, 2 months ago
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>
---
 src/qemu/qemu_process.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 1a0923af36..25ec464d3e 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -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;
 
-- 
2.15.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Ignore fallback CPU attribute on reconnect
Posted by Pavel Hrdina 6 years, 2 months ago
On Thu, Jan 11, 2018 at 10:30:04AM +0100, Jiri Denemark wrote:
> 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>
> ---
>  src/qemu/qemu_process.c | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list