From aa6c24efcb42aa55e9fff450ef65683b78153849 Mon Sep 17 00:00:00 2001 Message-ID: From: Jiri Denemark Date: Mon, 11 Mar 2024 15:34:37 +0100 Subject: [PATCH] qemu: domain: Check arch in qemuDomainMakeCPUMigratable The content is arch specific and checking for Icelake-Server CPU model on non-x86 architectures does not make sense. Signed-off-by: Jiri Denemark Reviewed-by: Tim Wiederhake Reviewed-by: Peter Krempa (cherry picked from commit 909564c3652d6f6fb5b68ebc5830c6cb524ac713) https://issues.redhat.com/browse/RHEL-25995 Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c | 14 ++++++++++---- src/qemu/qemu_domain.h | 3 ++- src/qemu/qemu_migration_cookie.c | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 97520bb49c..8e7665b198 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6588,10 +6588,15 @@ qemuDomainDefCopy(virQEMUDriver *driver, int -qemuDomainMakeCPUMigratable(virCPUDef *cpu) +qemuDomainMakeCPUMigratable(virArch arch, + virCPUDef *cpu) { - if (cpu->mode == VIR_CPU_MODE_CUSTOM && - STREQ_NULLABLE(cpu->model, "Icelake-Server")) { + if (cpu->mode != VIR_CPU_MODE_CUSTOM || + !cpu->model || + !ARCH_IS_X86(arch)) + return 0; + + if (STREQ(cpu->model, "Icelake-Server")) { /* Originally Icelake-Server CPU model contained pconfig CPU feature. * It was never actually enabled and thus it was removed. To enable * migration to QEMU 3.1.0 (with both new and old libvirt), we @@ -6781,7 +6786,8 @@ qemuDomainDefFormatBufInternal(virQEMUDriver *driver, return -1; } - if (def->cpu && qemuDomainMakeCPUMigratable(def->cpu) < 0) + if (def->cpu && + qemuDomainMakeCPUMigratable(def->os.arch, def->cpu) < 0) return -1; /* Old libvirt doesn't understand