conf: Accept 'default' backend type for <interface type='user'/>

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>
This commit is contained in:
Michal Privoznik 2024-06-28 09:36:24 +02:00
parent 6a0f45a9e0
commit 751a327423
2 changed files with 5 additions and 1 deletions

View 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;
}

View File

@ -3826,6 +3826,7 @@
<optional>
<attribute name="type">
<choice>
<value>default</value>
<value>passt</value>
</choice>
</attribute>