[PATCH] conf: Add more checks for VDS interface parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add some checks that commit 0225483adce9 forgot to include.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 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 6950f7ec1d8f..970cc85ded6c 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);
-- 
2.37.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux