From: Michal Privoznik <[email protected]>
Turns out, that synic hyperv enlightenment not always requires
vpindex. Some (older) machine types (e.g. pc-i440fx-3.0,
pc-i440fx-rhel7.6.0) can run with synic enabled and vpindex
disabled. This is because they did enable 'x-hv-synic-kvm-only'
CPU property, but starting from QEMU commit v3.1.0-rc0~44^2~9 the
property is disabled by default.
To avoid parsing machine type version, let's just skip this
dependency validation for all i440fx machine types with a note to
remove the limitation once affected machine types go out of
support.
Now, q35 has this dependency, although it might be not visible at
the first glance. Inside of target/i386/kvm/kvm.c there's
kvm_hyperv_properties[] array declared and in there
HYPERV_FEAT_SYNIC doesn't have any .dependencies set. But looking
couple of pages down at kvm_hyperv_expand_features() function,
there's the following check:
/* Additional dependencies not covered by kvm_hyperv_properties[] */
if (hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC) &&
!cpu->hyperv_synic_kvm_only &&
!hyperv_feat_enabled(cpu, HYPERV_FEAT_VPINDEX)) {
error_setg(errp, "Hyper-V %s requires Hyper-V %s",
kvm_hyperv_properties[HYPERV_FEAT_SYNIC].desc,
kvm_hyperv_properties[HYPERV_FEAT_VPINDEX].desc);
return false;
}
And as noted above, 'hyperv_synic_kvm_only' is false by default.
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/837
Resolves: https://issues.redhat.com/browse/RHEL-138689
Fixes: 1822d030c32d9857020ee8385b0a8808a29a472f
Signed-off-by: Michal Privoznik <[email protected]>
---
src/qemu/qemu_validate.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index da08fd17cd..a8b1029d0c 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -112,7 +112,13 @@ qemuValidateDomainDefHypervFeatures(const virDomainDef
*def)
return -1;
}
- CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_SYNIC, VIR_DOMAIN_HYPERV_VPINDEX);
+ if (!qemuDomainIsI440FX(def)) {
+ /* Some i440fx machine types don't have this dependency and unless we
+ * want to parse machine type version (we do not), just skip this
+ * check. The worst that'll happen is QEMU will error out later.
+ * TODO: Remove once pc-i440fx-3.0 is no longer supported. */
+ CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_SYNIC, VIR_DOMAIN_HYPERV_VPINDEX);
+ }
if (def->hyperv.features[VIR_DOMAIN_HYPERV_STIMER] ==
VIR_TRISTATE_SWITCH_ON) {
if (!virDomainDefHasTimer(def, VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK)) {
--
2.52.0