[PATCH v2 0/2] qemu: Relax hyperv features validation
v2 of: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/5FLYZ... diff to v1: - Patch 1/3 from original series is dropped, as I misunderstood QEMU's code and though Q35 is not affected. It is. - Patch 2/3 from original series is reworked to drop the check entirely, again, I blame my code misunderstanding. Michal Prívozník (2): qemu_validate: Drop VIR_DOMAIN_HYPERV_SYNIC dependency on VIR_DOMAIN_HYPERV_VPINDEX qemu_validate: Drop VIR_DOMAIN_HYPERV_STIMER dependency on VIR_DOMAIN_HYPERV_VPINDEX src/qemu/qemu_validate.c | 3 --- 1 file changed, 3 deletions(-) -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> Turns out, that synic hyperv enlightenment not always requires vpindex. Some (older) machine types (e.g. pc-i440fx-3.0, pc-q35-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 drop this dependency validation and rely on QEMU to report sensible error message. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/837 Resolves: https://issues.redhat.com/browse/RHEL-138689 Fixes: 1822d030c32d9857020ee8385b0a8808a29a472f Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/qemu/qemu_validate.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index da08fd17cd..3e27c11da3 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -112,8 +112,6 @@ qemuValidateDomainDefHypervFeatures(const virDomainDef *def) return -1; } - 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)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -- 2.52.0
On Tue, Jan 06, 2026 at 05:57:45PM +0100, Michal Privoznik via Devel wrote:
From: Michal Privoznik <mprivozn@redhat.com>
Turns out, that synic hyperv enlightenment not always requires vpindex. Some (older) machine types (e.g. pc-i440fx-3.0, pc-q35-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 drop this dependency validation and rely on QEMU to report sensible error message.
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/837 Resolves: https://issues.redhat.com/browse/RHEL-138689 Fixes: 1822d030c32d9857020ee8385b0a8808a29a472f Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/qemu/qemu_validate.c | 2 -- 1 file changed, 2 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
From: Michal Privoznik <mprivozn@redhat.com> The original commit (v11.9.0-rc1~84) added a dependency checking of VIR_DOMAIN_HYPERV_STIMER on VIR_DOMAIN_HYPERV_VPINDEX (meaning, if stimer is on then vpindex must also be on). It justified this by citing QEMU documentation: Per QEMU documentation (docs/system/i386/hyperv.rst): ``hv-stimer`` Enables Hyper-V synthetic timers. <snip/> Requires: ``hv-vpindex``, ``hv-synic``, ``hv-time`` While the documentation is almost correct (see previous commit when it's incorrect), the code express no dependency on vpindex (kvm_hyperv_properties[] array from target/i386/kvm/kvm.c): [HYPERV_FEAT_STIMER] = { .desc = "synthetic timers (hv-stimer)", .flags = { {.func = HV_CPUID_FEATURES, .reg = R_EAX, .bits = HV_SYNTIMERS_AVAILABLE} }, .dependencies = BIT(HYPERV_FEAT_SYNIC) | BIT(HYPERV_FEAT_TIME) }, If transitivity is taken into account then the documentation is of course correct (minus that one aforementioned special case). Well, there's no need for us to implement transitional checks. VIR_DOMAIN_HYPERV_STIMER requires VIR_DOMAIN_HYPERV_SYNIC and whether that requires VIR_DOMAIN_HYPERV_VPINDEX is another question. Just drop the transitive check. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/837 Resolves: https://issues.redhat.com/browse/RHEL-138689 Fixes: da261327ea94300d1aa2d3b76ba9dcd4de6160f6 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> --- src/qemu/qemu_validate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 3e27c11da3..66c59c3696 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -122,7 +122,6 @@ qemuValidateDomainDefHypervFeatures(const virDomainDef *def) } } - CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_STIMER, VIR_DOMAIN_HYPERV_VPINDEX); CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_STIMER, VIR_DOMAIN_HYPERV_SYNIC); CHECK_HV_FEAT(VIR_DOMAIN_HYPERV_TLBFLUSH, VIR_DOMAIN_HYPERV_VPINDEX); -- 2.52.0
participants (2)
-
Daniel P. Berrangé -
Michal Privoznik