Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
ce4c82f1
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看板
提交
ce4c82f1
编写于
4月 07, 2010
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cleanup x86Compute()
No change in semantics.
上级
71d5686f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
29 deletion
+17
-29
src/cpu/cpu_x86.c
src/cpu/cpu_x86.c
+17
-29
未找到文件。
src/cpu/cpu_x86.c
浏览文件 @
ce4c82f1
...
...
@@ -901,7 +901,7 @@ x86Compute(virCPUDefPtr host,
struct
x86_model
*
guest_model
=
NULL
;
virCPUCompareResult
ret
;
enum
compare_result
result
;
int
i
;
unsigned
int
i
;
if
(
cpu
->
arch
!=
NULL
)
{
bool
found
=
false
;
...
...
@@ -919,36 +919,15 @@ x86Compute(virCPUDefPtr host,
}
}
if
((
map
=
x86LoadMap
())
==
NULL
)
goto
error
;
if
(
!
(
host_model
=
x86ModelFromCPU
(
host
,
map
,
0
)))
goto
error
;
if
(
!
(
cpu_force
=
x86ModelFromCPU
(
cpu
,
map
,
VIR_CPU_FEATURE_FORCE
)))
goto
error
;
if
(
!
(
cpu_require
=
x86ModelFromCPU
(
cpu
,
map
,
VIR_CPU_FEATURE_REQUIRE
)))
goto
error
;
if
(
!
(
cpu_optional
=
x86ModelFromCPU
(
cpu
,
map
,
VIR_CPU_FEATURE_OPTIONAL
)))
goto
error
;
if
(
!
(
cpu_disable
=
x86ModelFromCPU
(
cpu
,
map
,
VIR_CPU_FEATURE_DISABLE
)))
goto
error
;
if
(
!
(
cpu_forbid
=
x86ModelFromCPU
(
cpu
,
map
,
VIR_CPU_FEATURE_FORBID
)))
if
(
!
(
map
=
x86LoadMap
())
||
!
(
host_model
=
x86ModelFromCPU
(
host
,
map
,
0
))
||
!
(
cpu_force
=
x86ModelFromCPU
(
cpu
,
map
,
VIR_CPU_FEATURE_FORCE
))
||
!
(
cpu_require
=
x86ModelFromCPU
(
cpu
,
map
,
VIR_CPU_FEATURE_REQUIRE
))
||
!
(
cpu_optional
=
x86ModelFromCPU
(
cpu
,
map
,
VIR_CPU_FEATURE_OPTIONAL
))
||
!
(
cpu_disable
=
x86ModelFromCPU
(
cpu
,
map
,
VIR_CPU_FEATURE_DISABLE
))
||
!
(
cpu_forbid
=
x86ModelFromCPU
(
cpu
,
map
,
VIR_CPU_FEATURE_FORBID
)))
goto
error
;
x86ModelSubtract
(
cpu_require
,
cpu_disable
);
if
((
diff
=
x86ModelCopy
(
host_model
))
==
NULL
)
goto
no_memory
;
x86ModelSubtract
(
diff
,
cpu_require
);
x86ModelSubtract
(
diff
,
cpu_optional
);
x86ModelSubtract
(
diff
,
cpu_force
);
for
(
i
=
0
;
i
<
cpu_forbid
->
ncpuid
;
i
++
)
{
const
struct
cpuX86cpuid
*
cpuid1
;
const
struct
cpuX86cpuid
*
cpuid2
;
...
...
@@ -966,6 +945,7 @@ x86Compute(virCPUDefPtr host,
}
}
x86ModelSubtract
(
cpu_require
,
cpu_disable
);
result
=
x86ModelCompare
(
host_model
,
cpu_require
);
if
(
result
==
SUBSET
||
result
==
UNRELATED
)
{
VIR_DEBUG0
(
"Host CPU does not provide all required features"
);
...
...
@@ -975,6 +955,14 @@ x86Compute(virCPUDefPtr host,
ret
=
VIR_CPU_COMPARE_IDENTICAL
;
if
((
diff
=
x86ModelCopy
(
host_model
))
==
NULL
)
goto
no_memory
;
x86ModelSubtract
(
diff
,
cpu_optional
);
x86ModelSubtract
(
diff
,
cpu_require
);
x86ModelSubtract
(
diff
,
cpu_disable
);
x86ModelSubtract
(
diff
,
cpu_force
);
for
(
i
=
0
;
i
<
host_model
->
ncpuid
;
i
++
)
{
if
(
!
x86cpuidMatch
(
host_model
->
cpuid
+
i
,
&
cpuid_zero
))
{
ret
=
VIR_CPU_COMPARE_SUPERSET
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录