mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-03 17:47:15 +03:00
qemu: Drop MSR features from host-model with old QEMU
With QEMU versions which lack "unavailable-features" we use CPUID based detection of features which were enabled or disabled once QEMU starts. Thus using MSR features with host-model would result in all of them being marked as disabled in the active domain definition even though QEMU did not actually disable them. Let's make sure we add MSR features to host-model only when "unavailable-features" property is supported by QEMU. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
8eb4a89f5f
commit
2674d00ed4
@ -3193,6 +3193,21 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (ARCH_IS_X86(qemuCaps->arch) &&
|
||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_UNAVAILABLE_FEATURES)) {
|
||||
if (cpu &&
|
||||
virCPUDefFilterFeatures(cpu, virCPUx86FeatureFilterDropMSR, NULL) < 0)
|
||||
goto error;
|
||||
|
||||
if (migCPU &&
|
||||
virCPUDefFilterFeatures(migCPU, virCPUx86FeatureFilterDropMSR, NULL) < 0)
|
||||
goto error;
|
||||
|
||||
if (fullCPU &&
|
||||
virCPUDefFilterFeatures(fullCPU, virCPUx86FeatureFilterDropMSR, NULL) < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
virQEMUCapsSetHostModel(qemuCaps, type, cpu, migCPU, fullCPU);
|
||||
|
||||
cleanup:
|
||||
|
@ -42,7 +42,6 @@
|
||||
<feature policy='require' name='xsaves'/>
|
||||
<feature policy='require' name='pdpe1gb'/>
|
||||
<feature policy='require' name='invtsc'/>
|
||||
<feature policy='require' name='skip-l1dfl-vmentry'/>
|
||||
</mode>
|
||||
<mode name='custom' supported='yes'>
|
||||
<model usable='yes'>qemu64</model>
|
||||
|
@ -42,7 +42,6 @@
|
||||
<feature policy='require' name='xsaves'/>
|
||||
<feature policy='require' name='pdpe1gb'/>
|
||||
<feature policy='require' name='invtsc'/>
|
||||
<feature policy='require' name='skip-l1dfl-vmentry'/>
|
||||
</mode>
|
||||
<mode name='custom' supported='yes'>
|
||||
<model usable='yes'>qemu64</model>
|
||||
|
Loading…
x
Reference in New Issue
Block a user