[PATCH] conf: Do not parse hyperv features with passthrough mode

Martin Kletzander posted 1 patch 1 week, 3 days ago
src/conf/domain_conf.c | 3 +++
1 file changed, 3 insertions(+)
[PATCH] conf: Do not parse hyperv features with passthrough mode
Posted by Martin Kletzander 1 week, 3 days ago
The schema does not allow that anyway and we then format them all back
which leads to libvirt producing an invalid XML.

Resolves: https://issues.redhat.com/browse/RHEL-70656
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
 src/conf/domain_conf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e658b68c48b6..3f88a77a8fea 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -16643,6 +16643,9 @@ virDomainFeaturesHyperVDefParse(virDomainDef *def,
 
     def->features[VIR_DOMAIN_FEATURE_HYPERV] = mode;
 
+    if (mode == VIR_DOMAIN_HYPERV_MODE_PASSTHROUGH)
+        return 0;
+
     node = xmlFirstElementChild(node);
     while (node != NULL) {
         int feature;
-- 
2.47.1
Re: [PATCH] conf: Do not parse hyperv features with passthrough mode
Posted by Michal Prívozník 1 week ago
On 1/10/25 16:12, Martin Kletzander wrote:
> The schema does not allow that anyway and we then format them all back
> which leads to libvirt producing an invalid XML.
> 
> Resolves: https://issues.redhat.com/browse/RHEL-70656
> Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
> ---
>  src/conf/domain_conf.c | 3 +++
>  1 file changed, 3 insertions(+)
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
and safe for freeze.

Michal