1 Star 0 Fork 71

baijing_0022/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
libvirt-qemu-add-pointer-check-in-qemuMonitorLastError.patch 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
From 2d72ad8dfbd8987379a58fd9b280cdaf4d191542 Mon Sep 17 00:00:00 2001
From: Feng Ni <fengni@huawei.com>
Date: Wed, 15 Apr 2020 11:14:35 +0800
Subject: qemu: add pointer check in qemuMonitorLastError
We found a exception when libvirt occurrs segmentation fault.
thread 1 is waiting object lock in qemuConnectMonitor,
qemu process exits and sends EOF event as well, so thread 2 invokes
qemuMonitorLastError but pointer mon is NULL.
Signed-off-by: Feng Ni <fengni@huawei.com>
Signed-off-by: Xu Yandong <xuyandong2@huawei.com>
---
src/qemu/qemu_monitor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index a62fed8..cc62948 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -966,7 +966,7 @@ qemuMonitorSend(qemuMonitorPtr mon,
virErrorPtr
qemuMonitorLastError(qemuMonitorPtr mon)
{
- if (mon->lastError.code == VIR_ERR_OK)
+ if (!mon || mon->lastError.code == VIR_ERR_OK)
return NULL;
return virErrorCopyNew(&mon->lastError);
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/baijing_0022/libvirt.git
git@gitee.com:baijing_0022/libvirt.git
baijing_0022
libvirt
libvirt
master

搜索帮助