1 Star 0 Fork 71

yoo/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
qemuMonitorAddObject-Fix-semantics-of-alias.patch 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
yezengruan 提交于 2022-03-24 14:54 . update patch with openeuler !58
From cf227a71451c95d2e5db3d0d79f108caf086234f Mon Sep 17 00:00:00 2001
From: Peter Krempa <pkrempa@redhat.com>
Date: Mon, 30 Nov 2020 16:21:18 +0100
Subject: [PATCH 04/16] qemuMonitorAddObject: Fix semantics of @alias
The callers of qemuMonitorAddObject rely on the fact that @alias is
filled only when the object is added successfully. This is documented
but the code didn't behave like that.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_monitor.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 0447b609fd..f573292e37 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -2966,11 +2966,14 @@ qemuMonitorAddObject(qemuMonitorPtr mon,
if (alias)
tmp = g_strdup(id);
- ret = qemuMonitorJSONAddObject(mon, props);
+ if (qemuMonitorJSONAddObject(mon, props) < 0)
+ goto cleanup;
if (alias)
*alias = g_steal_pointer(&tmp);
+ ret = 0;
+
cleanup:
VIR_FREE(tmp);
virJSONValueFree(*props);
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdLUbG/libvirt.git
git@gitee.com:mdLUbG/libvirt.git
mdLUbG
libvirt
libvirt
master

搜索帮助