Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
41f14d6e
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
41f14d6e
编写于
11月 21, 2008
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix crash due to failure to unregister event callbacks in QEMU driver (David Lively)
上级
f6dacb21
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
53 addition
and
1 deletion
+53
-1
ChangeLog
ChangeLog
+8
-0
src/domain_event.c
src/domain_event.c
+38
-0
src/domain_event.h
src/domain_event.h
+3
-0
src/qemu_driver.c
src/qemu_driver.c
+4
-1
未找到文件。
ChangeLog
浏览文件 @
41f14d6e
Fri Nov 21 10:14:14 BST 2008 Daniel P. Berrange <berrange@redhat.com>
Fix crash due to failure to unregister event callbacks on
connection close (David Lively)
* src/domain_event.c, src/domain_event.h: Helper for unregistering
all callbacks
* src/qemu_driver.c: Unregister all callbacks on connection close
Fri Nov 21 10:10:14 BST 2008 Daniel P. Berrange <berrange@redhat.com>
* src/Makefile.am: Include Xen compile flags for libvirt_driver.la
...
...
src/domain_event.c
浏览文件 @
41f14d6e
...
...
@@ -87,6 +87,44 @@ virDomainEventCallbackListRemove(virConnectPtr conn,
return
-
1
;
}
/**
* virDomainEventCallbackListRemoveConn:
* @conn: pointer to the connection
* @cbList: the list
*
* Internal function to remove all of a given connection's callback
* from a virDomainEventCallbackListPtr
*/
int
virDomainEventCallbackListRemoveConn
(
virConnectPtr
conn
,
virDomainEventCallbackListPtr
cbList
)
{
int
old_count
=
cbList
->
count
;
int
i
;
for
(
i
=
0
;
i
<
cbList
->
count
;
i
++
)
{
if
(
cbList
->
callbacks
[
i
]
->
conn
==
conn
)
{
virFreeCallback
freecb
=
cbList
->
callbacks
[
i
]
->
freecb
;
if
(
freecb
)
(
*
freecb
)(
cbList
->
callbacks
[
i
]
->
opaque
);
virUnrefConnect
(
cbList
->
callbacks
[
i
]
->
conn
);
VIR_FREE
(
cbList
->
callbacks
[
i
]);
if
(
i
<
(
cbList
->
count
-
1
))
memmove
(
cbList
->
callbacks
+
i
,
cbList
->
callbacks
+
i
+
1
,
sizeof
(
*
(
cbList
->
callbacks
))
*
(
cbList
->
count
-
(
i
+
1
)));
cbList
->
count
--
;
i
--
;
}
}
if
(
cbList
->
count
<
old_count
&&
VIR_REALLOC_N
(
cbList
->
callbacks
,
cbList
->
count
)
<
0
)
{
;
/* Failure to reduce memory allocation isn't fatal */
}
return
0
;
}
/**
* virDomainEventCallbackListAdd:
* @conn: pointer to the connection
...
...
src/domain_event.h
浏览文件 @
41f14d6e
...
...
@@ -55,6 +55,9 @@ int virDomainEventCallbackListRemove(virConnectPtr conn,
virDomainEventCallbackListPtr
cbList
,
virConnectDomainEventCallback
callback
);
int
virDomainEventCallbackListRemoveConn
(
virConnectPtr
conn
,
virDomainEventCallbackListPtr
cbList
);
/**
* Dispatching domain events that come in while
* in a call / response rpc
...
...
src/qemu_driver.c
浏览文件 @
41f14d6e
...
...
@@ -1235,7 +1235,10 @@ static virDrvOpenStatus qemudOpen(virConnectPtr conn,
}
static
int
qemudClose
(
virConnectPtr
conn
)
{
/*struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;*/
struct
qemud_driver
*
driver
=
(
struct
qemud_driver
*
)
conn
->
privateData
;
/* Get rid of callbacks registered for this conn */
virDomainEventCallbackListRemoveConn
(
conn
,
driver
->
domainEventCallbacks
);
conn
->
privateData
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录