1 Star 0 Fork 71

yoo/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
lxc-fix-error-value-of-lxcNodeGetSecurityModel.patch 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
yezengruan 提交于 2022-12-06 15:38 . libvirt update to version 6.2.0-47
From be72edbfc14440cceb63fa2d38811e5cbd962ad8 Mon Sep 17 00:00:00 2001
From: wangmeiyang <wangmeiyang_yewu@cmss.chinamobile.com>
Date: Wed, 30 Nov 2022 20:06:45 +0800
Subject: [PATCH 19/24] lxc: fix error value of lxcNodeGetSecurityModel
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When adding the ACL check and caps getter, we assumed that
the default return value is -1, not 0 as usual.
Fix the return value on error by assigning them explicitly.
cherry-pick from efe98ca98bb0febe6a8274175b7c5493c0d6c9f3
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Meiyang Wang <wangmeiyang_yewu@cmss.chinamobile.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/lxc/lxc_driver.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 71c7068bbf..aa4cddc275 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1240,11 +1240,13 @@ static int lxcNodeGetSecurityModel(virConnectPtr conn,
memset(secmodel, 0, sizeof(*secmodel));
- if (virNodeGetSecurityModelEnsureACL(conn) < 0)
- goto cleanup;
+ if (virNodeGetSecurityModelEnsureACL(conn) < 0) {
+ ret = -1;
+ }
- if (!(caps = virLXCDriverGetCapabilities(driver, false)))
- goto cleanup;
+ if (!(caps = virLXCDriverGetCapabilities(driver, false))) {
+ return = -1;
+ }
/* we treat no driver as success, but simply return no data in *secmodel */
if (caps->host.nsecModels == 0
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdLUbG/libvirt.git
git@gitee.com:mdLUbG/libvirt.git
mdLUbG
libvirt
libvirt
master

搜索帮助