Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
226f4054
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看板
提交
226f4054
编写于
12月 14, 2010
作者:
H
Hu Tao
提交者:
Eric Blake
12月 14, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a new function doStartCPUs
上级
fa139130
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
39 deletion
+24
-39
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+24
-39
未找到文件。
src/qemu/qemu_driver.c
浏览文件 @
226f4054
...
...
@@ -579,6 +579,21 @@ static void qemuDomainObjExitRemoteWithDriver(struct qemud_driver *driver,
virDomainObjUnref
(
obj
);
}
static
int
doStartCPUs
(
struct
qemud_driver
*
driver
,
virDomainObjPtr
vm
,
virConnectPtr
conn
)
{
int
ret
;
qemuDomainObjPrivatePtr
priv
=
vm
->
privateData
;
qemuDomainObjEnterMonitorWithDriver
(
driver
,
vm
);
ret
=
qemuMonitorStartCPUs
(
priv
->
mon
,
conn
);
if
(
ret
==
0
)
{
vm
->
state
=
VIR_DOMAIN_RUNNING
;
}
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
return
ret
;
}
static
int
doStopCPUs
(
struct
qemud_driver
*
driver
,
virDomainObjPtr
vm
)
{
int
ret
;
...
...
@@ -4245,19 +4260,18 @@ static int qemudStartVMDaemon(virConnectPtr conn,
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
goto
cleanup
;
}
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
if
(
!
start_paused
)
{
DEBUG0
(
"Starting domain CPUs"
);
/* Allow the CPUS to start executing */
if
(
qemuMonitorStartCPUs
(
priv
->
mon
,
conn
)
<
0
)
{
if
(
doStartCPUs
(
driver
,
vm
,
conn
)
<
0
)
{
if
(
virGetLastError
()
==
NULL
)
qemuReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"resume operation failed"
));
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
goto
cleanup
;
}
}
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
DEBUG0
(
"Writing domain status to disk"
);
...
...
@@ -5037,17 +5051,12 @@ static int qemudDomainResume(virDomainPtr dom) {
goto
endjob
;
}
if
(
vm
->
state
==
VIR_DOMAIN_PAUSED
)
{
qemuDomainObjPrivatePtr
priv
=
vm
->
privateData
;
qemuDomainObjEnterMonitorWithDriver
(
driver
,
vm
);
if
(
qemuMonitorStartCPUs
(
priv
->
mon
,
dom
->
conn
)
<
0
)
{
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
if
(
doStartCPUs
(
driver
,
vm
,
dom
->
conn
)
<
0
)
{
if
(
virGetLastError
()
==
NULL
)
qemuReportError
(
VIR_ERR_OPERATION_FAILED
,
"%s"
,
_
(
"resume operation failed"
));
goto
endjob
;
}
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
vm
->
state
=
VIR_DOMAIN_RUNNING
;
event
=
virDomainEventNewFromObj
(
vm
,
VIR_DOMAIN_EVENT_RESUMED
,
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED
);
...
...
@@ -5861,13 +5870,9 @@ endjob:
if
(
vm
)
{
if
(
ret
!=
0
)
{
if
(
header
.
was_running
&&
virDomainObjIsActive
(
vm
))
{
qemuDomainObjEnterMonitorWithDriver
(
driver
,
vm
);
rc
=
qemuMonitorStartCPUs
(
priv
->
mon
,
dom
->
conn
);
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
rc
=
doStartCPUs
(
driver
,
vm
,
dom
->
conn
);
if
(
rc
<
0
)
VIR_WARN0
(
"Unable to resume guest CPUs after save failure"
);
else
vm
->
state
=
VIR_DOMAIN_RUNNING
;
}
if
(
cgroup
!=
NULL
)
{
...
...
@@ -6249,14 +6254,11 @@ endjob:
will support synchronous operations so we always get here after
the migration is complete. */
else
if
(
resume
&&
paused
&&
virDomainObjIsActive
(
vm
))
{
qemuDomainObjEnterMonitorWithDriver
(
driver
,
vm
);
if
(
qemuMonitorStartCPUs
(
priv
->
mon
,
dom
->
conn
)
<
0
)
{
if
(
doStartCPUs
(
driver
,
vm
,
dom
->
conn
)
<
0
)
{
if
(
virGetLastError
()
==
NULL
)
qemuReportError
(
VIR_ERR_OPERATION_FAILED
,
"%s"
,
_
(
"resuming after dump failed"
));
}
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
vm
->
state
=
VIR_DOMAIN_RUNNING
;
}
if
(
qemuDomainObjEndJob
(
vm
)
==
0
)
...
...
@@ -6288,8 +6290,6 @@ static void processWatchdogEvent(void *data, void *opaque)
char
*
dumpfile
;
int
i
;
qemuDomainObjPrivatePtr
priv
=
wdEvent
->
vm
->
privateData
;
i
=
virAsprintf
(
&
dumpfile
,
"%s/%s-%u"
,
driver
->
autoDumpPath
,
wdEvent
->
vm
->
def
->
name
,
...
...
@@ -6315,9 +6315,7 @@ static void processWatchdogEvent(void *data, void *opaque)
qemuReportError
(
VIR_ERR_OPERATION_FAILED
,
"%s"
,
_
(
"Dump failed"
));
qemuDomainObjEnterMonitorWithDriver
(
driver
,
wdEvent
->
vm
);
ret
=
qemuMonitorStartCPUs
(
priv
->
mon
,
NULL
);
qemuDomainObjExitMonitorWithDriver
(
driver
,
wdEvent
->
vm
);
ret
=
doStartCPUs
(
driver
,
wdEvent
->
vm
,
NULL
);
if
(
ret
<
0
)
qemuReportError
(
VIR_ERR_OPERATION_FAILED
,
...
...
@@ -7172,17 +7170,12 @@ qemudDomainSaveImageStartVM(virConnectPtr conn,
/* If it was running before, resume it now. */
if
(
header
->
was_running
)
{
qemuDomainObjPrivatePtr
priv
=
vm
->
privateData
;
qemuDomainObjEnterMonitorWithDriver
(
driver
,
vm
);
if
(
qemuMonitorStartCPUs
(
priv
->
mon
,
conn
)
<
0
)
{
if
(
doStartCPUs
(
driver
,
vm
,
conn
)
<
0
)
{
if
(
virGetLastError
()
==
NULL
)
qemuReportError
(
VIR_ERR_OPERATION_FAILED
,
"%s"
,
_
(
"failed to resume domain"
));
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
goto
out
;
}
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
vm
->
state
=
VIR_DOMAIN_RUNNING
;
if
(
virDomainSaveStatus
(
driver
->
caps
,
driver
->
stateDir
,
vm
)
<
0
)
{
VIR_WARN
(
"Failed to save status on vm %s"
,
vm
->
def
->
name
);
goto
out
;
...
...
@@ -11936,8 +11929,7 @@ qemudDomainMigratePerform (virDomainPtr dom,
endjob:
if
(
resume
&&
vm
->
state
==
VIR_DOMAIN_PAUSED
)
{
/* we got here through some sort of failure; start the domain again */
qemuDomainObjEnterMonitorWithDriver
(
driver
,
vm
);
if
(
qemuMonitorStartCPUs
(
priv
->
mon
,
dom
->
conn
)
<
0
)
{
if
(
doStartCPUs
(
driver
,
vm
,
dom
->
conn
)
<
0
)
{
/* Hm, we already know we are in error here. We don't want to
* overwrite the previous error, though, so we just throw something
* to the logs and hope for the best
...
...
@@ -11945,9 +11937,7 @@ endjob:
VIR_ERROR
(
_
(
"Failed to resume guest %s after failure"
),
vm
->
def
->
name
);
}
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
vm
->
state
=
VIR_DOMAIN_RUNNING
;
event
=
virDomainEventNewFromObj
(
vm
,
VIR_DOMAIN_EVENT_RESUMED
,
VIR_DOMAIN_EVENT_RESUMED_MIGRATED
);
...
...
@@ -12103,17 +12093,12 @@ qemudDomainMigrateFinish2 (virConnectPtr dconn,
* >= 0.10.6 to work properly. This isn't strictly necessary on
* older qemu's, but it also doesn't hurt anything there
*/
qemuDomainObjEnterMonitorWithDriver
(
driver
,
vm
);
if
(
qemuMonitorStartCPUs
(
priv
->
mon
,
dconn
)
<
0
)
{
if
(
doStartCPUs
(
driver
,
vm
,
dconn
)
<
0
)
{
if
(
virGetLastError
()
==
NULL
)
qemuReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"resume operation failed"
));
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
goto
endjob
;
}
qemuDomainObjExitMonitorWithDriver
(
driver
,
vm
);
vm
->
state
=
VIR_DOMAIN_RUNNING
;
}
event
=
virDomainEventNewFromObj
(
vm
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录