]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
hyperv: fix flags passed to virDomainDefParseString()
authorJonathon Jongsma <jjongsma@redhat.com>
Fri, 27 Feb 2026 20:34:58 +0000 (14:34 -0600)
committerJonathon Jongsma <jjongsma@redhat.com>
Fri, 6 Mar 2026 16:27:39 +0000 (10:27 -0600)
This function expects flags that are bitwise-or values of the
VIR_DOMAIN_DEF_PARSE_* constants, but we were passing two flags that
were not part of this flag set:
 - 1 < VIR_DOMAIN_VIRT_HYPERV
 - VIR_DOMAIN_XML_INACTIVE

Replace VIR_DOMAIN_XML_INACTIVE with VIR_DOMAIN_DEF_PARSE_INACTIVE
(which fortunately happens to be the exact same value). Remove flag
"1 < VIR_DOMAIN_VIRT_HYPERV", which turns out to the the same value
as the flag VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION, which seems
unnecessary and undesirable here.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/hyperv/hyperv_driver.c

index 0dad27f0ecb0e94a4b090268e1d6885739431942..5f6f767e91d46ddb831e0ce1cfdcc06c984f1af6 100644 (file)
@@ -2939,7 +2939,7 @@ hypervDomainDefineXML(virConnectPtr conn, const char *xml)
 
     /* parse xml */
     def = virDomainDefParseString(xml, priv->xmlopt, NULL,
-                                  1 << VIR_DOMAIN_VIRT_HYPERV | VIR_DOMAIN_XML_INACTIVE);
+                                  VIR_DOMAIN_DEF_PARSE_INACTIVE);
 
     if (!def)
         goto error;