Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
ad6cc26c
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看板
提交
ad6cc26c
编写于
7月 19, 2011
作者:
J
Jiri Denemark
提交者:
Eric Blake
7月 27, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: Remove special case for virDomainSuspend
上级
63d15036
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
29 deletion
+24
-29
src/qemu/qemu_domain.h
src/qemu/qemu_domain.h
+0
-1
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+23
-23
src/qemu/qemu_migration.c
src/qemu/qemu_migration.c
+1
-5
未找到文件。
src/qemu/qemu_domain.h
浏览文件 @
ad6cc26c
...
...
@@ -74,7 +74,6 @@ enum qemuDomainAsyncJob {
enum
qemuDomainJobSignals
{
QEMU_JOB_SIGNAL_CANCEL
=
1
<<
0
,
/* Request job cancellation */
QEMU_JOB_SIGNAL_SUSPEND
=
1
<<
1
,
/* Request VM suspend to finish live migration offline */
};
struct
qemuDomainJobObj
{
...
...
src/qemu/qemu_driver.c
浏览文件 @
ad6cc26c
...
...
@@ -1331,6 +1331,8 @@ static int qemudDomainSuspend(virDomainPtr dom) {
int
ret
=
-
1
;
virDomainEventPtr
event
=
NULL
;
qemuDomainObjPrivatePtr
priv
;
virDomainPausedReason
reason
;
int
eventDetail
;
qemuDriverLock
(
driver
);
vm
=
virDomainFindByUUID
(
&
driver
->
domains
,
dom
->
uuid
);
...
...
@@ -1357,34 +1359,32 @@ static int qemudDomainSuspend(virDomainPtr dom) {
priv
=
vm
->
privateData
;
if
(
priv
->
job
.
asyncJob
==
QEMU_ASYNC_JOB_MIGRATION_OUT
)
{
if
(
virDomainObjGetState
(
vm
,
NULL
)
!=
VIR_DOMAIN_PAUSED
)
{
VIR_DEBUG
(
"Requesting domain pause on %s"
,
vm
->
def
->
name
);
priv
->
job
.
signals
|=
QEMU_JOB_SIGNAL_SUSPEND
;
}
ret
=
0
;
goto
cleanup
;
reason
=
VIR_DOMAIN_PAUSED_MIGRATION
;
eventDetail
=
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED
;
}
else
{
if
(
qemuDomainObjBeginJobWithDriver
(
driver
,
vm
,
QEMU_JOB_SUSPEND
)
<
0
)
goto
cleanup
;
reason
=
VIR_DOMAIN_PAUSED_USER
;
eventDetail
=
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED
;
}
if
(
!
virDomainObjIsActive
(
vm
))
{
qemuReportError
(
VIR_ERR_OPERATION_INVALID
,
"%s"
,
_
(
"domain is not running"
));
if
(
qemuDomainObjBeginJobWithDriver
(
driver
,
vm
,
QEMU_JOB_SUSPEND
)
<
0
)
goto
cleanup
;
if
(
!
virDomainObjIsActive
(
vm
))
{
qemuReportError
(
VIR_ERR_OPERATION_INVALID
,
"%s"
,
_
(
"domain is not running"
));
goto
endjob
;
}
if
(
virDomainObjGetState
(
vm
,
NULL
)
!=
VIR_DOMAIN_PAUSED
)
{
if
(
qemuProcessStopCPUs
(
driver
,
vm
,
reason
)
<
0
)
{
goto
endjob
;
}
if
(
virDomainObjGetState
(
vm
,
NULL
)
!=
VIR_DOMAIN_PAUSED
)
{
if
(
qemuProcessStopCPUs
(
driver
,
vm
,
VIR_DOMAIN_PAUSED_USER
)
<
0
)
{
goto
endjob
;
}
event
=
virDomainEventNewFromObj
(
vm
,
VIR_DOMAIN_EVENT_SUSPENDED
,
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED
);
}
if
(
virDomainSaveStatus
(
driver
->
caps
,
driver
->
stateDir
,
vm
)
<
0
)
goto
endjob
;
ret
=
0
;
event
=
virDomainEventNewFromObj
(
vm
,
VIR_DOMAIN_EVENT_SUSPENDED
,
eventDetail
);
}
if
(
virDomainSaveStatus
(
driver
->
caps
,
driver
->
stateDir
,
vm
)
<
0
)
goto
endjob
;
ret
=
0
;
endjob:
if
(
qemuDomainObjEndJob
(
driver
,
vm
)
==
0
)
...
...
src/qemu/qemu_migration.c
浏览文件 @
ad6cc26c
...
...
@@ -770,11 +770,6 @@ qemuMigrationProcessJobSignals(struct qemud_driver *driver,
if
(
ret
<
0
)
{
VIR_WARN
(
"Unable to cancel job"
);
}
}
else
if
(
priv
->
job
.
signals
&
QEMU_JOB_SIGNAL_SUSPEND
)
{
priv
->
job
.
signals
^=
QEMU_JOB_SIGNAL_SUSPEND
;
VIR_DEBUG
(
"Pausing domain for non-live migration"
);
if
(
qemuMigrationSetOffline
(
driver
,
vm
)
<
0
)
VIR_WARN
(
"Unable to pause domain"
);
}
else
{
ret
=
0
;
}
...
...
@@ -2861,6 +2856,7 @@ qemuMigrationJobStart(struct qemud_driver *driver,
qemuDomainObjSetAsyncJobMask
(
vm
,
QEMU_JOB_NONE
);
}
else
{
qemuDomainObjSetAsyncJobMask
(
vm
,
DEFAULT_JOB_MASK
|
JOB_MASK
(
QEMU_JOB_SUSPEND
)
|
JOB_MASK
(
QEMU_JOB_MIGRATION_OP
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录