From 1a6d497e64f668d16e7e431bd93efc5436d48a07 Mon Sep 17 00:00:00 2001
From: Bihong Yu <yubihong@huawei.com>
Date: Wed, 12 Jan 2022 12:17:39 +0100
Subject: [PATCH 01/22] virInterfaceDefDevFormat: Add missing error handling

Add missing error handling for virInterfaceDefDevFormat.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Bihong Yu <yubihong@huawei.com>
---
 src/conf/interface_conf.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c
index d1732621b5..c0744c3899 100644
--- a/src/conf/interface_conf.c
+++ b/src/conf/interface_conf.c
@@ -1110,13 +1110,16 @@ virInterfaceDefDevFormat(virBufferPtr buf,
                 virBufferAsprintf(buf, "<mac address='%s'/>\n", def->mac);
             break;
         case VIR_INTERFACE_TYPE_BRIDGE:
-            virInterfaceBridgeDefFormat(buf, def);
+            if (virInterfaceBridgeDefFormat(buf, def) < 0)
+                return -1;
             break;
         case VIR_INTERFACE_TYPE_BOND:
-            virInterfaceBondDefFormat(buf, def);
+            if (virInterfaceBondDefFormat(buf, def) < 0)
+                return -1;
             break;
         case VIR_INTERFACE_TYPE_VLAN:
-            virInterfaceVlanDefFormat(buf, def);
+            if (virInterfaceVlanDefFormat(buf, def) < 0)
+                return -1;
             break;
     }
 
-- 
2.33.0

