1 Star 0 Fork 71

tzr/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
virInterfaceDefDevFormat-Add-missing-error-handling.patch 1.44 KB
一键复制 编辑 原始数据 按行查看 历史
Jiangjiacheng 提交于 2023-01-04 12:02 . Backport patches from upstream
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tom0392/libvirt.git
git@gitee.com:tom0392/libvirt.git
tom0392
libvirt
libvirt
master

搜索帮助