1 Star 0 Fork 71

tzr/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Fix-allocation-of-virDomainFSDef.patch 1.77 KB
一键复制 编辑 原始数据 按行查看 历史
yezengruan 提交于 2022-11-25 19:41 . sync some bugfix patches from upstream
From 805efc1e0446e84c4b9bf9984c92b9e05b6ced62 Mon Sep 17 00:00:00 2001
From: tangbin <tangbin_yewu@cmss.chinamobile.com>
Date: Wed, 23 Nov 2022 16:00:29 +0200
Subject: [PATCH 09/23] Fix allocation of virDomainFSDef
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Some less commonly used drivers were omitted when we switched
the allocator from a plain VIR_ALLOC to virDomainFSDefNew.
https://bugzilla.redhat.com/show_bug.cgi?id=1846450
Fixes: da665fbd4858890fbb3bbf5da2a7b6ca37bb3220
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
(cherry-pick from ea3320048897f5279bc49cb49d26f8099706a834)
---
src/openvz/openvz_conf.c | 2 +-
src/vbox/vbox_common.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 78547b8b28..15e1e2ae9f 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -357,7 +357,7 @@ openvzReadFSConf(virDomainDefPtr def,
goto error;
}
- if (VIR_ALLOC(fs) < 0)
+ if (!(fs = virDomainFSDefNew(NULL)))
goto error;
veid_str = g_strdup_printf("%d", veid);
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index e98ae04ec0..d06a5f79ab 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -3620,7 +3620,7 @@ vboxDumpSharedFolders(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine
char *hostPath = NULL;
PRBool writable = PR_FALSE;
- if (VIR_ALLOC(def->fss[i]) < 0)
+ if (!(def->fss[i] = virDomainFSDefNew(data->xmlopt)))
goto cleanup;
def->fss[i]->type = VIR_DOMAIN_FS_TYPE_MOUNT;
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tom0392/libvirt.git
git@gitee.com:tom0392/libvirt.git
tom0392
libvirt
libvirt
master

搜索帮助