]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Accept 'default' backend type for <interface type='user'/>
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 28 Jun 2024 07:36:24 +0000 (09:36 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 1 Jul 2024 10:38:21 +0000 (12:38 +0200)
After previous commits, domain capabilities XML reports basically
two possible values for backend type: 'default' and 'passt'.
Despite its misleading name, 'default' really means 'use
hypervisor's builtin SLIRP'. Since it's reported in domain
capabilities as a value accepted, make our parser and XML schema
accept it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/domain_conf.c
src/conf/schemas/domaincommon.rng

index cb1154b23f09093b536cf5f71b8533cffd56931c..334152c4ff7f6512f8e666c2b7e15f430a91b64d 100644 (file)
@@ -9320,8 +9320,11 @@ virDomainNetBackendParseXML(xmlNodePtr node,
     g_autofree char *tap = virXMLPropString(node, "tap");
     g_autofree char *vhost = virXMLPropString(node, "vhost");
 
+    /* The VIR_DOMAIN_NET_BACKEND_DEFAULT really means 'use hypervisor's
+     * builtin SLIRP'. It's reported in domain caps and thus we need to accept
+     * it. Hence VIR_XML_PROP_NONE instead of VIR_XML_PROP_NONZERO. */
     if (virXMLPropEnum(node, "type", virDomainNetBackendTypeFromString,
-                       VIR_XML_PROP_NONZERO, &def->backend.type) < 0) {
+                       VIR_XML_PROP_NONE, &def->backend.type) < 0) {
         return -1;
     }
 
index 844a931deb24904430c33aad0d1899889736a981..33e34255f483151118d9f47e4bda9e07fe503b2b 100644 (file)
           <optional>
             <attribute name="type">
               <choice>
+                <value>default</value>
                 <value>passt</value>
               </choice>
             </attribute>