1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-24 06:03:52 +03:00

qemuProcessUpdateGuestCPU: Check host cpu for forbidden features

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

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com
This commit is contained in:
Tim Wiederhake 2021-03-23 11:01:55 +01:00 committed by Jiri Denemark
parent a839fcbe62
commit c5d4d0198f

View File

@ -6125,6 +6125,16 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def,
if (virCPUConvertLegacy(hostarch, def->cpu) < 0)
return -1;
if (def->cpu->check != VIR_CPU_CHECK_NONE) {
virCPUDefPtr host;
host = virQEMUCapsGetHostModel(qemuCaps, def->virtType,
VIR_QEMU_CAPS_HOST_CPU_FULL);
if (host && virCPUCheckForbiddenFeatures(def->cpu, host) < 0)
return -1;
}
/* nothing to update for host-passthrough / maximum */
if (def->cpu->mode != VIR_CPU_MODE_HOST_PASSTHROUGH &&
def->cpu->mode != VIR_CPU_MODE_MAXIMUM) {