[PATCH libvirt] interface: don't error out if a bond has no interfaces

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

 



It's not a problem at all and causes virt-manager to break down.

Note: netcf 0.2.8 generates invalid XML for a bond with no interfaces anyway,
so this error is in fact not reached as we fail earlier. Fix submitted upstream.

Signed-off-by: Lubomir Rintel <lkundrak@xxxxx>
---
 src/conf/interface_conf.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c
index c2eb945..29769ac 100644
--- a/src/conf/interface_conf.c
+++ b/src/conf/interface_conf.c
@@ -553,19 +553,15 @@ virInterfaceDefParseBondItfs(virInterfaceDefPtr def,
     nbItf = virXPathNodeSet("./interface", ctxt, &interfaces);
     if (nbItf < 0) {
         ret = -1;
-        goto error;
+        goto cleanup;
     }
 
-    if (nbItf == 0) {
-        virReportError(VIR_ERR_XML_ERROR,
-                       "%s", _("bond has no interfaces"));
-        ret = -1;
-        goto error;
-    }
+    if (nbItf == 0)
+        goto cleanup;
 
     if (VIR_ALLOC_N(def->data.bond.itf, nbItf) < 0) {
         ret = -1;
-        goto error;
+        goto cleanup;
     }
     def->data.bond.nbItf = nbItf;
 
@@ -575,12 +571,12 @@ virInterfaceDefParseBondItfs(virInterfaceDefPtr def,
         if (itf == NULL) {
             ret = -1;
             def->data.bond.nbItf = i;
-            goto error;
+            goto cleanup;
         }
         def->data.bond.itf[i] = itf;
     }
 
- error:
+ cleanup:
     VIR_FREE(interfaces);
     ctxt->node = bond;
     return ret;
-- 
2.4.1

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