From 751a3274230ec6ee10b517b6301eef6a9d34ba2b Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 28 Jun 2024 09:36:24 +0200 Subject: [PATCH] conf: Accept 'default' backend type for 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 Reviewed-by: Peter Krempa --- src/conf/domain_conf.c | 5 ++++- src/conf/schemas/domaincommon.rng | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index cb1154b23f..334152c4ff 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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; } diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng index 844a931deb..33e34255f4 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -3826,6 +3826,7 @@ + default passt