From 574769ceb62a4f5eab650cd6900fb8d680964534 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 9 Sep 2024 16:46:04 +0200 Subject: [PATCH] virDomainFeaturesHyperVDefParse: Don't overwrite hypervisor vendor_id In case when the user specifies the '' feature multiple times we could overwrite already parsed data. Clear it beforehand. As before this isn't trying to address the case of features being specified multiple times not making much sense. Closes: https://gitlab.com/libvirt/libvirt/-/issues/675 Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/conf/domain_conf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d72870d87d..e31b674bc2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -16621,6 +16621,8 @@ virDomainFeaturesHyperVDefParse(virDomainDef *def, if (value != VIR_TRISTATE_SWITCH_ON) break; + g_clear_pointer(&def->hyperv_vendor_id, g_free); + if (!(def->hyperv_vendor_id = virXMLPropString(node, "value"))) { virReportError(VIR_ERR_XML_ERROR, "%s", _("missing 'value' attribute for HyperV feature 'vendor_id'")); -- 2.39.5