From 5eb962fc1d5705b85c5e4dc78c3d4246ad729e69 Mon Sep 17 00:00:00 2001 From: Martin Kletzander Date: Tue, 30 Aug 2022 14:41:04 +0200 Subject: [PATCH] conf: Add more checks for VDS interface parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add some checks that commit 0225483adce9 forgot to include. Signed-off-by: Martin Kletzander Reviewed-by: Daniel P. Berrangé --- src/conf/domain_conf.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6950f7ec1d..970cc85ded 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9336,6 +9336,27 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, goto error; } + if (!portid) { + virReportError(VIR_ERR_XML_ERROR, + _("Missing source portid for interface type '%s'"), + virDomainNetTypeToString(def->type)); + goto error; + } + + if (!connectionid) { + virReportError(VIR_ERR_XML_ERROR, + _("Missing source connectionid for interface type '%s'"), + virDomainNetTypeToString(def->type)); + goto error; + } + + if (!portgroup) { + virReportError(VIR_ERR_XML_ERROR, + _("Missing source portgroup for interface type '%s'"), + virDomainNetTypeToString(def->type)); + goto error; + } + if (virUUIDParse(switchid, def->data.vds.switch_id) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Unable to parse switchid '%s'"), switchid);