[PATCH] Error out on missing address in 'server' type interface

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

 



It was possible to add the following interface:
<interface type='server'>
  <source port='5558'/>
</interface>

Resulting in:
error: internal error Process exited while reading console log output:
char device redirected to /dev/pts/4
2014-08-15T05:59:17.348271Z qemu-kvm: -netdev
socket,listen=(null):5558,id=hostnet0: Device 'socket' could not be
initialized

We already do this check for NET_TYPE_CLIENT and NET_TYPE_MCAST,
do it also for NET_TYPE_SERVER.

https://bugzilla.redhat.com/show_bug.cgi?id=1130390
---
 src/conf/domain_conf.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5c762fa..7ea628c 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7118,13 +7118,10 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
         }
 
         if (address == NULL) {
-            if (def->type == VIR_DOMAIN_NET_TYPE_CLIENT ||
-                def->type == VIR_DOMAIN_NET_TYPE_MCAST) {
-                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                               _("No <source> 'address' attribute "
-                                 "specified with socket interface"));
-                goto error;
-            }
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("No <source> 'address' attribute "
+                             "specified with socket interface"));
+            goto error;
         } else {
             def->data.socket.address = address;
             address = NULL;
-- 
1.8.5.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]