Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
54c68333
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看板
提交
54c68333
编写于
12月 14, 2010
作者:
H
Hu Tao
提交者:
Eric Blake
12月 14, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a macro timeval_to_ms to compute micro seconds from timeval
上级
8806c0db
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
14 deletion
+10
-14
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+10
-14
未找到文件。
src/qemu/qemu_driver.c
浏览文件 @
54c68333
...
...
@@ -96,6 +96,8 @@
#define QEMU_NAMESPACE_HREF "http://libvirt.org/schemas/domain/qemu/1.0"
#define timeval_to_ms(tv) (((tv).tv_sec * 1000ull) + ((tv).tv_usec / 1000))
/* Only 1 job is allowed at any time
* A job includes *all* monitor commands, even those just querying
* information, not merely actions */
...
...
@@ -376,8 +378,7 @@ static int qemuDomainObjBeginJob(virDomainObjPtr obj)
_
(
"cannot get time of day"
));
return
-
1
;
}
then
=
(
now
.
tv_sec
*
1000ull
)
+
(
now
.
tv_usec
/
1000
);
then
+=
QEMU_JOB_WAIT_TIME
;
then
=
timeval_to_ms
(
now
)
+
QEMU_JOB_WAIT_TIME
;
virDomainObjRef
(
obj
);
...
...
@@ -396,7 +397,7 @@ static int qemuDomainObjBeginJob(virDomainObjPtr obj)
priv
->
jobActive
=
QEMU_JOB_UNSPECIFIED
;
priv
->
jobSignals
=
0
;
memset
(
&
priv
->
jobSignalsData
,
0
,
sizeof
(
priv
->
jobSignalsData
));
priv
->
jobStart
=
(
now
.
tv_sec
*
1000ull
)
+
(
now
.
tv_usec
/
1000
);
priv
->
jobStart
=
timeval_to_ms
(
now
);
memset
(
&
priv
->
jobInfo
,
0
,
sizeof
(
priv
->
jobInfo
));
return
0
;
...
...
@@ -422,8 +423,7 @@ static int qemuDomainObjBeginJobWithDriver(struct qemud_driver *driver,
_
(
"cannot get time of day"
));
return
-
1
;
}
then
=
(
now
.
tv_sec
*
1000ull
)
+
(
now
.
tv_usec
/
1000
);
then
+=
QEMU_JOB_WAIT_TIME
;
then
=
timeval_to_ms
(
now
)
+
QEMU_JOB_WAIT_TIME
;
virDomainObjRef
(
obj
);
qemuDriverUnlock
(
driver
);
...
...
@@ -444,7 +444,7 @@ static int qemuDomainObjBeginJobWithDriver(struct qemud_driver *driver,
priv
->
jobActive
=
QEMU_JOB_UNSPECIFIED
;
priv
->
jobSignals
=
0
;
memset
(
&
priv
->
jobSignalsData
,
0
,
sizeof
(
priv
->
jobSignalsData
));
priv
->
jobStart
=
(
now
.
tv_sec
*
1000ull
)
+
(
now
.
tv_usec
/
1000
);
priv
->
jobStart
=
timeval_to_ms
(
now
);
memset
(
&
priv
->
jobInfo
,
0
,
sizeof
(
priv
->
jobInfo
));
virDomainObjUnlock
(
obj
);
...
...
@@ -5469,9 +5469,7 @@ qemuDomainWaitForMigrationComplete(struct qemud_driver *driver, virDomainObjPtr
_
(
"cannot get time of day"
));
goto
cleanup
;
}
priv
->
jobInfo
.
timeElapsed
=
((
now
.
tv_sec
*
1000ull
)
+
(
now
.
tv_usec
/
1000
))
-
priv
->
jobStart
;
priv
->
jobInfo
.
timeElapsed
=
timeval_to_ms
(
now
)
-
priv
->
jobStart
;
switch
(
status
)
{
case
QEMU_MONITOR_MIGRATION_STATUS_INACTIVE
:
...
...
@@ -11154,7 +11152,7 @@ endjob:
virDomainObjIsActive
(
vm
))
{
priv
->
jobActive
=
QEMU_JOB_MIGRATION_IN
;
priv
->
jobInfo
.
type
=
VIR_DOMAIN_JOB_UNBOUNDED
;
priv
->
jobStart
=
(
now
.
tv_sec
*
1000ull
)
+
(
now
.
tv_usec
/
1000
);
priv
->
jobStart
=
timeval_to_ms
(
now
);
}
cleanup:
...
...
@@ -11382,7 +11380,7 @@ endjob:
virDomainObjIsActive
(
vm
))
{
priv
->
jobActive
=
QEMU_JOB_MIGRATION_IN
;
priv
->
jobInfo
.
type
=
VIR_DOMAIN_JOB_UNBOUNDED
;
priv
->
jobStart
=
(
now
.
tv_sec
*
1000ull
)
+
(
now
.
tv_usec
/
1000
);
priv
->
jobStart
=
timeval_to_ms
(
now
);
}
cleanup:
...
...
@@ -12371,9 +12369,7 @@ static int qemuDomainGetJobInfo(virDomainPtr dom,
_
(
"cannot get time of day"
));
goto
cleanup
;
}
info
->
timeElapsed
=
((
now
.
tv_sec
*
1000ull
)
+
(
now
.
tv_usec
/
1000
))
-
priv
->
jobStart
;
info
->
timeElapsed
=
timeval_to_ms
(
now
)
-
priv
->
jobStart
;
}
else
{
memset
(
info
,
0
,
sizeof
(
*
info
));
info
->
type
=
VIR_DOMAIN_JOB_NONE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录