Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
cf091094
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,发现更多精彩内容 >>
提交
cf091094
编写于
2月 18, 2016
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: Add support for job completed event
Signed-off-by:
N
Jiri Denemark
<
jdenemar@redhat.com
>
上级
f2893001
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
31 addition
and
2 deletion
+31
-2
src/qemu/qemu_domain.c
src/qemu/qemu_domain.c
+24
-0
src/qemu/qemu_domain.h
src/qemu/qemu_domain.h
+2
-0
src/qemu/qemu_migration.c
src/qemu/qemu_migration.c
+5
-2
未找到文件。
src/qemu/qemu_domain.c
浏览文件 @
cf091094
...
@@ -149,6 +149,30 @@ void qemuDomainEventQueue(virQEMUDriverPtr driver,
...
@@ -149,6 +149,30 @@ void qemuDomainEventQueue(virQEMUDriverPtr driver,
}
}
void
qemuDomainEventEmitJobCompleted
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
)
{
qemuDomainObjPrivatePtr
priv
=
vm
->
privateData
;
virObjectEventPtr
event
;
virTypedParameterPtr
params
=
NULL
;
int
nparams
=
0
;
int
type
;
if
(
!
priv
->
job
.
completed
)
return
;
if
(
qemuDomainJobInfoToParams
(
priv
->
job
.
completed
,
&
type
,
&
params
,
&
nparams
)
<
0
)
{
VIR_WARN
(
"Could not get stats for completed job; domain %s"
,
vm
->
def
->
name
);
}
event
=
virDomainEventJobCompletedNewFromObj
(
vm
,
params
,
nparams
);
qemuDomainEventQueue
(
driver
,
event
);
}
static
int
static
int
qemuDomainObjInitJob
(
qemuDomainObjPrivatePtr
priv
)
qemuDomainObjInitJob
(
qemuDomainObjPrivatePtr
priv
)
{
{
...
...
src/qemu/qemu_domain.h
浏览文件 @
cf091094
...
@@ -265,6 +265,8 @@ void qemuDomainEventFlush(int timer, void *opaque);
...
@@ -265,6 +265,8 @@ void qemuDomainEventFlush(int timer, void *opaque);
void
qemuDomainEventQueue
(
virQEMUDriverPtr
driver
,
void
qemuDomainEventQueue
(
virQEMUDriverPtr
driver
,
virObjectEventPtr
event
);
virObjectEventPtr
event
);
void
qemuDomainEventEmitJobCompleted
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
);
int
qemuDomainObjBeginJob
(
virQEMUDriverPtr
driver
,
int
qemuDomainObjBeginJob
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
obj
,
virDomainObjPtr
obj
,
...
...
src/qemu/qemu_migration.c
浏览文件 @
cf091094
...
@@ -3866,7 +3866,7 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
...
@@ -3866,7 +3866,7 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
int
retcode
)
int
retcode
)
{
{
qemuMigrationCookiePtr
mig
;
qemuMigrationCookiePtr
mig
;
virObjectEventPtr
event
=
NULL
;
virObjectEventPtr
event
;
int
rv
=
-
1
;
int
rv
=
-
1
;
virQEMUDriverConfigPtr
cfg
=
virQEMUDriverGetConfig
(
driver
);
virQEMUDriverConfigPtr
cfg
=
virQEMUDriverGetConfig
(
driver
);
qemuDomainObjPrivatePtr
priv
=
vm
->
privateData
;
qemuDomainObjPrivatePtr
priv
=
vm
->
privateData
;
...
@@ -3921,6 +3921,8 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
...
@@ -3921,6 +3921,8 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
event
=
virDomainEventLifecycleNewFromObj
(
vm
,
event
=
virDomainEventLifecycleNewFromObj
(
vm
,
VIR_DOMAIN_EVENT_STOPPED
,
VIR_DOMAIN_EVENT_STOPPED
,
VIR_DOMAIN_EVENT_STOPPED_MIGRATED
);
VIR_DOMAIN_EVENT_STOPPED_MIGRATED
);
qemuDomainEventQueue
(
driver
,
event
);
qemuDomainEventEmitJobCompleted
(
driver
,
vm
);
}
else
{
}
else
{
virErrorPtr
orig_err
=
virSaveLastError
();
virErrorPtr
orig_err
=
virSaveLastError
();
...
@@ -3935,6 +3937,7 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
...
@@ -3935,6 +3937,7 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
event
=
virDomainEventLifecycleNewFromObj
(
vm
,
event
=
virDomainEventLifecycleNewFromObj
(
vm
,
VIR_DOMAIN_EVENT_RESUMED
,
VIR_DOMAIN_EVENT_RESUMED
,
VIR_DOMAIN_EVENT_RESUMED_MIGRATED
);
VIR_DOMAIN_EVENT_RESUMED_MIGRATED
);
qemuDomainEventQueue
(
driver
,
event
);
}
}
if
(
virDomainSaveStatus
(
driver
->
xmlopt
,
cfg
->
stateDir
,
vm
,
driver
->
caps
)
<
0
)
if
(
virDomainSaveStatus
(
driver
->
xmlopt
,
cfg
->
stateDir
,
vm
,
driver
->
caps
)
<
0
)
...
@@ -3946,7 +3949,6 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
...
@@ -3946,7 +3949,6 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
rv
=
0
;
rv
=
0
;
cleanup:
cleanup:
qemuDomainEventQueue
(
driver
,
event
);
virObjectUnref
(
cfg
);
virObjectUnref
(
cfg
);
return
rv
;
return
rv
;
}
}
...
@@ -6071,6 +6073,7 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
...
@@ -6071,6 +6073,7 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
if
(
cmd
&&
virCommandWait
(
cmd
,
NULL
)
<
0
)
if
(
cmd
&&
virCommandWait
(
cmd
,
NULL
)
<
0
)
goto
cleanup
;
goto
cleanup
;
qemuDomainEventEmitJobCompleted
(
driver
,
vm
);
ret
=
0
;
ret
=
0
;
cleanup:
cleanup:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录