]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Add more checks for VDS interface parameters v8.7.0-rc2
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 30 Aug 2022 12:41:04 +0000 (14:41 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 30 Aug 2022 12:56:49 +0000 (14:56 +0200)
Add some checks that commit 0225483adce9 forgot to include.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/conf/domain_conf.c

index 6950f7ec1d8f0018b0002e6e0c41845f41a29d7c..970cc85ded6c51ae8b4ba314c349cb4772c03eef 100644 (file)
@@ -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);