1 Star 0 Fork 71

lIshaohui/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tests-Don-t-leak-cpu-defs.patch 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
From 5ad5d48df150a4025eb7628596f3715ba4a91eb1 Mon Sep 17 00:00:00 2001
From: Michal Privoznik <mprivozn@redhat.com>
Date: Fri, 30 Jul 2021 10:34:50 +0200
Subject: [PATCH 098/108] tests: Don't leak cpu defs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
There are cpu definitions that are allocated in
qemuTestDriverInit() but are missing corresponding
virCPUDefFree() call in qemuTestDriverFree(). It's safe to call
the free function because the definitions contain a refcounter
and thus even if they were still in use the refcounter would be
just decreased.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 73890139bfa248e3a714feb5566144510c3e97dc)
---
tests/testutilsqemu.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 6c43f07015..0e932877e8 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -317,6 +317,11 @@ void qemuTestDriverFree(virQEMUDriver *driver)
virObjectUnref(driver->caps);
virObjectUnref(driver->config);
virObjectUnref(driver->securityManager);
+
+ virCPUDefFree(cpuDefault);
+ virCPUDefFree(cpuHaswell);
+ virCPUDefFree(cpuPower8);
+ virCPUDefFree(cpuPower9);
}
int qemuTestCapsCacheInsert(virFileCachePtr cache,
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/li-shaohui/libvirt.git
git@gitee.com:li-shaohui/libvirt.git
li-shaohui
libvirt
libvirt
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385