Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
7405aebe
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看板
提交
7405aebe
编写于
5月 12, 2011
作者:
C
Cole Robinson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libxl: Convert to virDomainEventState
上级
4d7297f8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
62 deletion
+24
-62
src/libxl/libxl_conf.h
src/libxl/libxl_conf.h
+1
-5
src/libxl/libxl_driver.c
src/libxl/libxl_driver.c
+23
-57
未找到文件。
src/libxl/libxl_conf.h
浏览文件 @
7405aebe
...
...
@@ -61,11 +61,7 @@ struct _libxlDriverPrivate {
virBitmapPtr
reservedVNCPorts
;
virDomainObjList
domains
;
/* A list of callbacks */
virDomainEventCallbackListPtr
domainEventCallbacks
;
virDomainEventQueuePtr
domainEventQueue
;
int
domainEventTimer
;
int
domainEventDispatching
;
virDomainEventStatePtr
domainEventState
;
char
*
configDir
;
char
*
autostartDir
;
...
...
src/libxl/libxl_driver.c
浏览文件 @
7405aebe
...
...
@@ -130,28 +130,11 @@ static void
libxlDomainEventFlush
(
int
timer
ATTRIBUTE_UNUSED
,
void
*
opaque
)
{
libxlDriverPrivatePtr
driver
=
opaque
;
virDomainEventQueue
tempQueue
;
libxlDriverLock
(
driver
);
driver
->
domainEventDispatching
=
1
;
/* Copy the queue, so we're reentrant safe */
tempQueue
.
count
=
driver
->
domainEventQueue
->
count
;
tempQueue
.
events
=
driver
->
domainEventQueue
->
events
;
driver
->
domainEventQueue
->
count
=
0
;
driver
->
domainEventQueue
->
events
=
NULL
;
virEventUpdateTimeout
(
driver
->
domainEventTimer
,
-
1
);
virDomainEventQueueDispatch
(
&
tempQueue
,
driver
->
domainEventCallbacks
,
libxlDomainEventDispatchFunc
,
driver
);
/* Purge any deleted callbacks */
virDomainEventCallbackListPurgeMarked
(
driver
->
domainEventCallbacks
);
driver
->
domainEventDispatching
=
0
;
virDomainEventStateFlush
(
driver
->
domainEventState
,
libxmlDomainEventDispatchFunc
,
driver
);
libxlDriverUnlock
(
driver
);
}
...
...
@@ -159,10 +142,7 @@ libxlDomainEventFlush(int timer ATTRIBUTE_UNUSED, void *opaque)
static
void
libxlDomainEventQueue
(
libxlDriverPrivatePtr
driver
,
virDomainEventPtr
event
)
{
if
(
virDomainEventQueuePush
(
driver
->
domainEventQueue
,
event
)
<
0
)
virDomainEventFree
(
event
);
if
(
driver
->
domainEventQueue
->
count
==
1
)
virEventUpdateTimeout
(
driver
->
domainEventTimer
,
0
);
virDomainEventStateQueue
(
driver
->
domainEventState
,
event
);
}
/*
...
...
@@ -706,12 +686,7 @@ libxlShutdown(void)
VIR_FREE
(
libxl_driver
->
libDir
);
VIR_FREE
(
libxl_driver
->
saveDir
);
/* Free domain callback list */
virDomainEventCallbackListFree
(
libxl_driver
->
domainEventCallbacks
);
virDomainEventQueueFree
(
libxl_driver
->
domainEventQueue
);
if
(
libxl_driver
->
domainEventTimer
!=
-
1
)
virEventRemoveTimeout
(
libxl_driver
->
domainEventTimer
);
virDomainEventStateFree
(
privconn
->
domainEventState
);
libxlDriverUnlock
(
libxl_driver
);
virMutexDestroy
(
&
libxl_driver
->
lock
);
...
...
@@ -822,16 +797,14 @@ libxlStartup(int privileged) {
}
VIR_FREE
(
log_file
);
/* Init callback list */
if
(
VIR_ALLOC
(
libxl_driver
->
domainEventCallbacks
)
<
0
)
goto
out_of_memory
;
if
(
!
(
libxl_driver
->
domainEventQueue
=
virDomainEventQueueNew
()))
goto
out_of_memory
;
if
((
libxl_driver
->
domainEventTimer
=
virEventAddTimeout
(
-
1
,
libxlDomainEventFlush
,
libxl_driver
,
NULL
))
<
0
)
libxl_driver
->
domainEventState
=
virDomainEventStateNew
(
libxlDomainEventFlush
,
libxml_driver
,
NULL
,
false
);
if
(
!
libxml_driver
->
domainEventState
)
goto
error
;
libxl_driver
->
logger
=
(
xentoollog_logger
*
)
xtl_createlogger_stdiostream
(
libxl_driver
->
logger_file
,
XTL_DEBUG
,
0
);
if
(
!
libxl_driver
->
logger
)
{
...
...
@@ -982,7 +955,8 @@ libxlClose(virConnectPtr conn ATTRIBUTE_UNUSED)
libxlDriverPrivatePtr
driver
=
conn
->
privateData
;
libxlDriverLock
(
driver
);
virDomainEventCallbackListRemoveConn
(
conn
,
driver
->
domainEventCallbacks
);
virDomainEventCallbackListRemoveConn
(
conn
,
driver
->
domainEventState
->
callbacks
);
libxlDriverUnlock
(
driver
);
conn
->
privateData
=
NULL
;
return
0
;
...
...
@@ -2224,7 +2198,8 @@ libxlDomainEventRegister(virConnectPtr conn,
int
ret
;
libxlDriverLock
(
driver
);
ret
=
virDomainEventCallbackListAdd
(
conn
,
driver
->
domainEventCallbacks
,
ret
=
virDomainEventCallbackListAdd
(
conn
,
driver
->
domainEventState
->
callbacks
,
callback
,
opaque
,
freecb
);
libxlDriverUnlock
(
driver
);
...
...
@@ -2240,14 +2215,9 @@ libxlDomainEventDeregister(virConnectPtr conn,
int
ret
;
libxlDriverLock
(
driver
);
if
(
driver
->
domainEventDispatching
)
ret
=
virDomainEventCallbackListMarkDelete
(
conn
,
driver
->
domainEventCallbacks
,
callback
);
else
ret
=
virDomainEventCallbackListRemove
(
conn
,
driver
->
domainEventCallbacks
,
callback
);
ret
=
virDomainEventStateDeregister
(
conn
,
driver
->
domainEventState
,
callback
);
libxlDriverUnlock
(
driver
);
return
ret
;
...
...
@@ -2648,7 +2618,8 @@ libxlDomainEventRegisterAny(virConnectPtr conn, virDomainPtr dom, int eventID,
int
ret
;
libxlDriverLock
(
driver
);
ret
=
virDomainEventCallbackListAddID
(
conn
,
driver
->
domainEventCallbacks
,
ret
=
virDomainEventCallbackListAddID
(
conn
,
driver
->
domainEventState
->
callbacks
,
dom
,
eventID
,
callback
,
opaque
,
freecb
);
libxlDriverUnlock
(
driver
);
...
...
@@ -2664,14 +2635,9 @@ libxlDomainEventDeregisterAny(virConnectPtr conn, int callbackID)
int
ret
;
libxlDriverLock
(
driver
);
if
(
driver
->
domainEventDispatching
)
ret
=
virDomainEventCallbackListMarkDeleteID
(
conn
,
driver
->
domainEventCallbacks
,
callbackID
);
else
ret
=
virDomainEventCallbackListRemoveID
(
conn
,
driver
->
domainEventCallbacks
,
callbackID
);
ret
=
virDomainEventStateDeregisterAny
(
conn
,
driver
->
domainEventState
,
callbackID
);
libxlDriverUnlock
(
driver
);
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录