diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index db18b90d22..f1ad7ad1f1 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6882,6 +6882,7 @@ qemuProcessRefreshCPU(virQEMUDriverPtr driver, { virCapsPtr caps = virQEMUDriverGetCapabilities(driver, false); virCPUDefPtr host = NULL; + virCPUDefPtr cpu = NULL; int ret = -1; if (!caps) @@ -6903,7 +6904,13 @@ qemuProcessRefreshCPU(virQEMUDriverPtr driver, if (!(host = virCPUCopyMigratable(caps->host.cpu->arch, caps->host.cpu))) goto cleanup; - if (virCPUUpdate(vm->def->os.arch, vm->def->cpu, host) < 0) + if (!(cpu = virCPUDefCopyWithoutModel(host)) || + virCPUDefCopyModelFilter(cpu, host, false, + virQEMUCapsCPUFilterFeatures, + &caps->host.cpu->arch) < 0) + goto cleanup; + + if (virCPUUpdate(vm->def->os.arch, vm->def->cpu, cpu) < 0) goto cleanup; if (qemuProcessUpdateCPU(driver, vm, QEMU_ASYNC_JOB_NONE) < 0) @@ -6913,6 +6920,7 @@ qemuProcessRefreshCPU(virQEMUDriverPtr driver, ret = 0; cleanup: + virCPUDefFree(cpu); virCPUDefFree(host); virObjectUnref(caps); return ret;