1 Star 0 Fork 71

tzr/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
qemu-fix-memleak-in-qemuDomainAttachDeviceLive.patch 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
yezengruan 提交于 2022-11-25 19:41 . sync some bugfix patches from upstream
From d1c3b60ebbfe0fad5372cf2940b366f00548a4fe Mon Sep 17 00:00:00 2001
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
Date: Wed, 23 Nov 2022 10:00:57 +0000
Subject: [PATCH 07/23] qemu: fix memleak in qemuDomainAttachDeviceLive()
During disk hot plugging, qemuDomainAttachDeviceLive() adds the new disk to
the device list of the VM object. However, hot plugging cdroms and floppies
only updates the src variable of the original disk device, so the newly
generated disk object needs to be freed.
Signed-off-by: Jin Yan <jinyan12@huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
(cherry-pick from 2f470a4fb1edbe2da702e398314b9db201bb991e)
---
src/qemu/qemu_hotplug.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index d7bcb6a99f..c9347bac04 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1115,6 +1115,7 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver,
return -1;
disk->src = NULL;
+ virDomainDiskDefFree(disk);
return 0;
}
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tom0392/libvirt.git
git@gitee.com:tom0392/libvirt.git
tom0392
libvirt
libvirt
master

搜索帮助