Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
bc01151a
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,发现更多精彩内容 >>
提交
bc01151a
编写于
5月 11, 2016
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cpu_x86: Rename struct x86_map
Signed-off-by:
N
Jiri Denemark
<
jdenemar@redhat.com
>
上级
449e2d43
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
32 deletion
+34
-32
src/cpu/cpu_x86.c
src/cpu/cpu_x86.c
+34
-32
未找到文件。
src/cpu/cpu_x86.c
浏览文件 @
bc01151a
...
...
@@ -101,14 +101,16 @@ struct _virCPUx86Model {
virCPUx86ModelPtr
next
;
};
struct
x86_map
{
typedef
struct
_virCPUx86Map
virCPUx86Map
;
typedef
virCPUx86Map
*
virCPUx86MapPtr
;
struct
_virCPUx86Map
{
virCPUx86VendorPtr
vendors
;
virCPUx86FeaturePtr
features
;
virCPUx86ModelPtr
models
;
virCPUx86FeaturePtr
migrate_blockers
;
};
static
struct
x86_map
*
virCPUx86
Map
;
static
virCPUx86MapPtr
cpu
Map
;
int
virCPUx86MapOnceInit
(
void
);
VIR_ONCE_GLOBAL_INIT
(
virCPUx86Map
);
...
...
@@ -408,7 +410,7 @@ static int
x86DataToCPUFeatures
(
virCPUDefPtr
cpu
,
int
policy
,
virCPUx86Data
*
data
,
const
struct
x86_map
*
map
)
virCPUx86MapPtr
map
)
{
virCPUx86FeaturePtr
feature
=
map
->
features
;
...
...
@@ -428,7 +430,7 @@ x86DataToCPUFeatures(virCPUDefPtr cpu,
/* also removes bits corresponding to vendor string from data */
static
virCPUx86VendorPtr
x86DataToVendor
(
virCPUx86Data
*
data
,
const
struct
x86_map
*
map
)
virCPUx86MapPtr
map
)
{
virCPUx86VendorPtr
vendor
=
map
->
vendors
;
virCPUx86CPUID
*
cpuid
;
...
...
@@ -449,7 +451,7 @@ x86DataToVendor(virCPUx86Data *data,
static
virCPUDefPtr
x86DataToCPU
(
const
virCPUx86Data
*
data
,
virCPUx86ModelPtr
model
,
const
struct
x86_map
*
map
)
virCPUx86MapPtr
map
)
{
virCPUDefPtr
cpu
;
virCPUx86Data
*
copy
=
NULL
;
...
...
@@ -500,7 +502,7 @@ x86VendorFree(virCPUx86VendorPtr vendor)
static
virCPUx86VendorPtr
x86VendorFind
(
const
struct
x86_map
*
map
,
x86VendorFind
(
virCPUx86MapPtr
map
,
const
char
*
name
)
{
virCPUx86VendorPtr
vendor
;
...
...
@@ -519,7 +521,7 @@ x86VendorFind(const struct x86_map *map,
static
int
x86VendorLoad
(
xmlXPathContextPtr
ctxt
,
struct
x86_map
*
map
)
virCPUx86MapPtr
map
)
{
virCPUx86VendorPtr
vendor
=
NULL
;
char
*
string
=
NULL
;
...
...
@@ -631,7 +633,7 @@ x86FeatureCopy(virCPUx86FeaturePtr src)
static
virCPUx86FeaturePtr
x86FeatureFind
(
const
struct
x86_map
*
map
,
x86FeatureFind
(
virCPUx86MapPtr
map
,
const
char
*
name
)
{
virCPUx86FeaturePtr
feature
;
...
...
@@ -649,7 +651,7 @@ x86FeatureFind(const struct x86_map *map,
static
char
*
x86FeatureNames
(
const
struct
x86_map
*
map
,
x86FeatureNames
(
virCPUx86MapPtr
map
,
const
char
*
separator
,
virCPUx86Data
*
data
)
{
...
...
@@ -707,7 +709,7 @@ x86ParseCPUID(xmlXPathContextPtr ctxt,
static
int
x86FeatureLoad
(
xmlXPathContextPtr
ctxt
,
struct
x86_map
*
map
)
virCPUx86MapPtr
map
)
{
xmlNodePtr
*
nodes
=
NULL
;
xmlNodePtr
ctxt_node
=
ctxt
->
node
;
...
...
@@ -790,7 +792,7 @@ x86FeatureLoad(xmlXPathContextPtr ctxt,
static
virCPUx86Data
*
x86DataFromCPUFeatures
(
virCPUDefPtr
cpu
,
const
struct
x86_map
*
map
)
virCPUx86MapPtr
map
)
{
virCPUx86Data
*
data
;
size_t
i
;
...
...
@@ -866,7 +868,7 @@ x86ModelCopy(virCPUx86ModelPtr model)
static
virCPUx86ModelPtr
x86ModelFind
(
const
struct
x86_map
*
map
,
x86ModelFind
(
virCPUx86MapPtr
map
,
const
char
*
name
)
{
virCPUx86ModelPtr
model
;
...
...
@@ -885,7 +887,7 @@ x86ModelFind(const struct x86_map *map,
static
virCPUx86ModelPtr
x86ModelFromCPU
(
const
virCPUDef
*
cpu
,
const
struct
x86_map
*
map
,
virCPUx86MapPtr
map
,
int
policy
)
{
virCPUx86ModelPtr
model
=
NULL
;
...
...
@@ -934,7 +936,7 @@ x86ModelFromCPU(const virCPUDef *cpu,
static
int
x86ModelSubtractCPU
(
virCPUx86ModelPtr
model
,
const
virCPUDef
*
cpu
,
const
struct
x86_map
*
map
)
virCPUx86MapPtr
map
)
{
virCPUx86ModelPtr
cpu_model
;
size_t
i
;
...
...
@@ -1013,7 +1015,7 @@ x86ModelCompare(virCPUx86ModelPtr model1,
static
int
x86ModelLoad
(
xmlXPathContextPtr
ctxt
,
struct
x86_map
*
map
)
virCPUx86MapPtr
map
)
{
xmlNodePtr
*
nodes
=
NULL
;
virCPUx86ModelPtr
model
;
...
...
@@ -1126,7 +1128,7 @@ x86ModelLoad(xmlXPathContextPtr ctxt,
static
void
x86MapFree
(
struct
x86_map
*
map
)
x86MapFree
(
virCPUx86MapPtr
map
)
{
if
(
map
==
NULL
)
return
;
...
...
@@ -1164,7 +1166,7 @@ x86MapLoadCallback(cpuMapElement element,
xmlXPathContextPtr
ctxt
,
void
*
data
)
{
struct
x86_map
*
map
=
data
;
virCPUx86MapPtr
map
=
data
;
switch
(
element
)
{
case
CPU_MAP_ELEMENT_VENDOR
:
...
...
@@ -1182,7 +1184,7 @@ x86MapLoadCallback(cpuMapElement element,
static
int
x86MapLoadInternalFeatures
(
struct
x86_map
*
map
)
x86MapLoadInternalFeatures
(
virCPUx86MapPtr
map
)
{
size_t
i
;
virCPUx86FeaturePtr
feature
=
NULL
;
...
...
@@ -1223,10 +1225,10 @@ x86MapLoadInternalFeatures(struct x86_map *map)
}
static
struct
x86_map
*
static
virCPUx86MapPtr
virCPUx86LoadMap
(
void
)
{
struct
x86_map
*
map
;
virCPUx86MapPtr
map
;
if
(
VIR_ALLOC
(
map
)
<
0
)
return
NULL
;
...
...
@@ -1248,20 +1250,20 @@ virCPUx86LoadMap(void)
int
virCPUx86MapOnceInit
(
void
)
{
if
(
!
(
virCPUx86
Map
=
virCPUx86LoadMap
()))
if
(
!
(
cpu
Map
=
virCPUx86LoadMap
()))
return
-
1
;
return
0
;
}
static
const
struct
x86_map
*
static
virCPUx86MapPtr
virCPUx86GetMap
(
void
)
{
if
(
virCPUx86MapInitialize
()
<
0
)
return
NULL
;
return
virCPUx86
Map
;
return
cpu
Map
;
}
...
...
@@ -1373,7 +1375,7 @@ x86Compute(virCPUDefPtr host,
virCPUDataPtr
*
guest
,
char
**
message
)
{
const
struct
x86_map
*
map
=
NULL
;
virCPUx86MapPtr
map
=
NULL
;
virCPUx86ModelPtr
host_model
=
NULL
;
virCPUx86ModelPtr
cpu_force
=
NULL
;
virCPUx86ModelPtr
cpu_require
=
NULL
;
...
...
@@ -1569,7 +1571,7 @@ x86Decode(virCPUDefPtr cpu,
unsigned
int
flags
)
{
int
ret
=
-
1
;
const
struct
x86_map
*
map
;
virCPUx86MapPtr
map
;
virCPUx86ModelPtr
candidate
;
virCPUDefPtr
cpuCandidate
;
virCPUDefPtr
cpuModel
=
NULL
;
...
...
@@ -1711,7 +1713,7 @@ x86DecodeCPUData(virCPUDefPtr cpu,
static
virCPUx86Data
*
x86EncodePolicy
(
const
virCPUDef
*
cpu
,
const
struct
x86_map
*
map
,
virCPUx86MapPtr
map
,
virCPUFeaturePolicy
policy
)
{
virCPUx86ModelPtr
model
;
...
...
@@ -1738,7 +1740,7 @@ x86Encode(virArch arch,
virCPUDataPtr
*
forbidden
,
virCPUDataPtr
*
vendor
)
{
const
struct
x86_map
*
map
=
NULL
;
virCPUx86MapPtr
map
=
NULL
;
virCPUx86Data
*
data_forced
=
NULL
;
virCPUx86Data
*
data_required
=
NULL
;
virCPUx86Data
*
data_optional
=
NULL
;
...
...
@@ -1943,7 +1945,7 @@ x86Baseline(virCPUDefPtr *cpus,
unsigned
int
nmodels
,
unsigned
int
flags
)
{
const
struct
x86_map
*
map
=
NULL
;
virCPUx86MapPtr
map
=
NULL
;
virCPUx86ModelPtr
base_model
=
NULL
;
virCPUDefPtr
cpu
=
NULL
;
size_t
i
;
...
...
@@ -2067,7 +2069,7 @@ x86UpdateCustom(virCPUDefPtr guest,
{
int
ret
=
-
1
;
size_t
i
;
const
struct
x86_map
*
map
;
virCPUx86MapPtr
map
;
virCPUx86ModelPtr
host_model
=
NULL
;
if
(
!
(
map
=
virCPUx86GetMap
())
||
...
...
@@ -2113,7 +2115,7 @@ x86UpdateHostModel(virCPUDefPtr guest,
bool
passthrough
)
{
virCPUDefPtr
oldguest
=
NULL
;
const
struct
x86_map
*
map
;
virCPUx86MapPtr
map
;
virCPUx86FeaturePtr
feat
;
size_t
i
;
int
ret
=
-
1
;
...
...
@@ -2191,7 +2193,7 @@ static int
x86HasFeature
(
const
virCPUData
*
data
,
const
char
*
name
)
{
const
struct
x86_map
*
map
;
virCPUx86MapPtr
map
;
virCPUx86FeaturePtr
feature
;
int
ret
=
-
1
;
...
...
@@ -2210,7 +2212,7 @@ x86HasFeature(const virCPUData *data,
static
int
x86GetModels
(
char
***
models
)
{
const
struct
x86_map
*
map
;
virCPUx86MapPtr
map
;
virCPUx86ModelPtr
model
;
char
*
name
;
size_t
nmodels
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录