Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
57d52b24
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看板
提交
57d52b24
编写于
12月 18, 2012
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace union cpuData with virCPUData
上级
d87ca6ef
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
70 addition
and
69 deletion
+70
-69
src/cpu/cpu.c
src/cpu/cpu.c
+11
-11
src/cpu/cpu.h
src/cpu/cpu.h
+26
-25
src/cpu/cpu_arm.c
src/cpu/cpu_arm.c
+4
-4
src/cpu/cpu_powerpc.c
src/cpu/cpu_powerpc.c
+4
-4
src/cpu/cpu_s390.c
src/cpu/cpu_s390.c
+4
-4
src/cpu/cpu_x86.c
src/cpu/cpu_x86.c
+15
-15
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.c
+1
-1
src/qemu/qemu_command.c
src/qemu/qemu_command.c
+2
-2
src/vmware/vmware_conf.c
src/vmware/vmware_conf.c
+1
-1
tests/cputest.c
tests/cputest.c
+2
-2
未找到文件。
src/cpu/cpu.c
浏览文件 @
57d52b24
...
...
@@ -130,7 +130,7 @@ cpuCompare(virCPUDefPtr host,
int
cpuDecode
(
virCPUDefPtr
cpu
,
const
union
cpuData
*
data
,
const
virCPUDataPtr
data
,
const
char
**
models
,
unsigned
int
nmodels
,
const
char
*
preferred
)
...
...
@@ -174,12 +174,12 @@ cpuDecode(virCPUDefPtr cpu,
int
cpuEncode
(
virArch
arch
,
const
virCPUDefPtr
cpu
,
union
cpuData
*
*
forced
,
union
cpuData
*
*
required
,
union
cpuData
*
*
optional
,
union
cpuData
*
*
disabled
,
union
cpuData
*
*
forbidden
,
union
cpuData
*
*
vendor
)
virCPUDataPtr
*
forced
,
virCPUDataPtr
*
required
,
virCPUDataPtr
*
optional
,
virCPUDataPtr
*
disabled
,
virCPUDataPtr
*
forbidden
,
virCPUDataPtr
*
vendor
)
{
struct
cpuArchDriver
*
driver
;
...
...
@@ -205,7 +205,7 @@ cpuEncode(virArch arch,
void
cpuDataFree
(
virArch
arch
,
union
cpuData
*
data
)
virCPUDataPtr
data
)
{
struct
cpuArchDriver
*
driver
;
...
...
@@ -228,7 +228,7 @@ cpuDataFree(virArch arch,
}
union
cpuData
*
virCPUDataPtr
cpuNodeData
(
virArch
arch
)
{
struct
cpuArchDriver
*
driver
;
...
...
@@ -252,7 +252,7 @@ cpuNodeData(virArch arch)
virCPUCompareResult
cpuGuestData
(
virCPUDefPtr
host
,
virCPUDefPtr
guest
,
union
cpuData
*
*
data
,
virCPUDataPtr
*
data
,
char
**
msg
)
{
struct
cpuArchDriver
*
driver
;
...
...
@@ -420,7 +420,7 @@ cpuUpdate(virCPUDefPtr guest,
int
cpuHasFeature
(
virArch
arch
,
const
union
cpuData
*
data
,
const
virCPUDataPtr
data
,
const
char
*
feature
)
{
struct
cpuArchDriver
*
driver
;
...
...
src/cpu/cpu.h
浏览文件 @
57d52b24
...
...
@@ -32,11 +32,12 @@
# include "cpu_ppc_data.h"
union
cpuData
{
typedef
union
_virCPUData
virCPUData
;
typedef
virCPUData
*
virCPUDataPtr
;
union
_virCPUData
{
struct
cpuX86Data
*
x86
;
/* generic driver needs no data */
/* PowerPC driver need data*/
struct
cpuPPCData
ppc
;
/* generic driver needs no data */
};
...
...
@@ -46,30 +47,30 @@ typedef virCPUCompareResult
typedef
int
(
*
cpuArchDecode
)
(
virCPUDefPtr
cpu
,
const
union
cpuData
*
data
,
const
virCPUDataPtr
data
,
const
char
**
models
,
unsigned
int
nmodels
,
const
char
*
preferred
);
typedef
int
(
*
cpuArchEncode
)
(
const
virCPUDefPtr
cpu
,
union
cpuData
*
*
forced
,
union
cpuData
*
*
required
,
union
cpuData
*
*
optional
,
union
cpuData
*
*
disabled
,
union
cpuData
*
*
forbidden
,
union
cpuData
*
*
vendor
);
virCPUDataPtr
*
forced
,
virCPUDataPtr
*
required
,
virCPUDataPtr
*
optional
,
virCPUDataPtr
*
disabled
,
virCPUDataPtr
*
forbidden
,
virCPUDataPtr
*
vendor
);
typedef
void
(
*
cpuArchDataFree
)
(
union
cpuData
*
data
);
(
*
cpuArchDataFree
)
(
virCPUDataPtr
data
);
typedef
union
cpuData
*
typedef
virCPUDataPtr
(
*
cpuArchNodeData
)
(
void
);
typedef
virCPUCompareResult
(
*
cpuArchGuestData
)
(
virCPUDefPtr
host
,
virCPUDefPtr
guest
,
union
cpuData
*
*
data
,
virCPUDataPtr
*
data
,
char
**
message
);
typedef
virCPUDefPtr
...
...
@@ -83,7 +84,7 @@ typedef int
const
virCPUDefPtr
host
);
typedef
int
(
*
cpuArchHasFeature
)
(
const
union
cpuData
*
data
,
(
*
cpuArchHasFeature
)
(
const
virCPUDataPtr
data
,
const
char
*
feature
);
...
...
@@ -113,7 +114,7 @@ cpuCompare (virCPUDefPtr host,
extern
int
cpuDecode
(
virCPUDefPtr
cpu
,
const
union
cpuData
*
data
,
const
virCPUDataPtr
data
,
const
char
**
models
,
unsigned
int
nmodels
,
const
char
*
preferred
);
...
...
@@ -121,24 +122,24 @@ cpuDecode (virCPUDefPtr cpu,
extern
int
cpuEncode
(
virArch
arch
,
const
virCPUDefPtr
cpu
,
union
cpuData
*
*
forced
,
union
cpuData
*
*
required
,
union
cpuData
*
*
optional
,
union
cpuData
*
*
disabled
,
union
cpuData
*
*
forbidden
,
union
cpuData
*
*
vendor
);
virCPUDataPtr
*
forced
,
virCPUDataPtr
*
required
,
virCPUDataPtr
*
optional
,
virCPUDataPtr
*
disabled
,
virCPUDataPtr
*
forbidden
,
virCPUDataPtr
*
vendor
);
extern
void
cpuDataFree
(
virArch
arch
,
union
cpuData
*
data
);
virCPUDataPtr
data
);
extern
union
cpuData
*
extern
virCPUDataPtr
cpuNodeData
(
virArch
arch
);
extern
virCPUCompareResult
cpuGuestData
(
virCPUDefPtr
host
,
virCPUDefPtr
guest
,
union
cpuData
*
*
data
,
virCPUDataPtr
*
data
,
char
**
msg
);
extern
char
*
...
...
@@ -159,7 +160,7 @@ cpuUpdate (virCPUDefPtr guest,
extern
int
cpuHasFeature
(
virArch
arch
,
const
union
cpuData
*
data
,
const
virCPUDataPtr
data
,
const
char
*
feature
);
...
...
src/cpu/cpu_arm.c
浏览文件 @
57d52b24
...
...
@@ -30,10 +30,10 @@
static
const
virArch
archs
[]
=
{
VIR_ARCH_ARMV7L
};
static
union
cpuData
*
static
virCPUDataPtr
ArmNodeData
(
void
)
{
union
cpuData
*
data
;
virCPUDataPtr
data
;
ignore_value
(
VIR_ALLOC
(
data
));
return
data
;
...
...
@@ -41,7 +41,7 @@ ArmNodeData(void)
static
int
ArmDecode
(
virCPUDefPtr
cpu
ATTRIBUTE_UNUSED
,
const
union
cpuData
*
data
ATTRIBUTE_UNUSED
,
const
virCPUDataPtr
data
ATTRIBUTE_UNUSED
,
const
char
**
models
ATTRIBUTE_UNUSED
,
unsigned
int
nmodels
ATTRIBUTE_UNUSED
,
const
char
*
preferred
ATTRIBUTE_UNUSED
)
...
...
@@ -50,7 +50,7 @@ ArmDecode(virCPUDefPtr cpu ATTRIBUTE_UNUSED,
}
static
void
ArmDataFree
(
union
cpuData
*
data
)
ArmDataFree
(
virCPUDataPtr
data
)
{
VIR_FREE
(
data
);
}
...
...
src/cpu/cpu_powerpc.c
浏览文件 @
57d52b24
...
...
@@ -301,7 +301,7 @@ ppcCompare(virCPUDefPtr host,
static
int
ppcDecode
(
virCPUDefPtr
cpu
,
const
union
cpuData
*
data
,
const
virCPUDataPtr
data
,
const
char
**
models
,
unsigned
int
nmodels
,
const
char
*
preferred
ATTRIBUTE_UNUSED
)
...
...
@@ -342,7 +342,7 @@ cleanup:
static
void
ppcDataFree
(
union
cpuData
*
data
)
ppcDataFree
(
virCPUDataPtr
data
)
{
if
(
data
==
NULL
)
return
;
...
...
@@ -351,10 +351,10 @@ ppcDataFree(union cpuData *data)
}
#if defined(__powerpc__) || defined(__powerpc64__)
static
union
cpuData
*
static
virCPUDataPtr
ppcNodeData
(
void
)
{
union
cpuData
*
data
;
virCPUDataPtr
data
;
if
(
VIR_ALLOC
(
data
)
<
0
)
return
NULL
;
...
...
src/cpu/cpu_s390.c
浏览文件 @
57d52b24
...
...
@@ -31,10 +31,10 @@
static
const
virArch
archs
[]
=
{
VIR_ARCH_S390
,
VIR_ARCH_S390X
};
static
union
cpuData
*
static
virCPUDataPtr
s390NodeData
(
void
)
{
union
cpuData
*
data
;
virCPUDataPtr
data
;
if
(
VIR_ALLOC
(
data
)
<
0
)
return
NULL
;
...
...
@@ -45,7 +45,7 @@ s390NodeData(void)
static
int
s390Decode
(
virCPUDefPtr
cpu
ATTRIBUTE_UNUSED
,
const
union
cpuData
*
data
ATTRIBUTE_UNUSED
,
const
virCPUDataPtr
data
ATTRIBUTE_UNUSED
,
const
char
**
models
ATTRIBUTE_UNUSED
,
unsigned
int
nmodels
ATTRIBUTE_UNUSED
,
const
char
*
preferred
ATTRIBUTE_UNUSED
)
...
...
@@ -54,7 +54,7 @@ s390Decode(virCPUDefPtr cpu ATTRIBUTE_UNUSED,
}
static
void
s390DataFree
(
union
cpuData
*
data
)
s390DataFree
(
virCPUDataPtr
data
)
{
VIR_FREE
(
data
);
}
...
...
src/cpu/cpu_x86.c
浏览文件 @
57d52b24
...
...
@@ -215,10 +215,10 @@ x86DataFree(struct cpuX86Data *data)
}
static
union
cpuData
*
static
virCPUDataPtr
x86MakeCPUData
(
struct
cpuX86Data
**
data
)
{
union
cpuData
*
cpuData
;
virCPUDataPtr
cpuData
;
if
(
VIR_ALLOC
(
cpuData
)
<
0
)
return
NULL
;
...
...
@@ -230,7 +230,7 @@ x86MakeCPUData(struct cpuX86Data **data)
}
static
void
x86FreeCPUData
(
union
cpuData
*
data
)
x86FreeCPUData
(
virCPUDataPtr
data
)
{
if
(
!
data
)
return
;
...
...
@@ -1151,7 +1151,7 @@ error:
static
virCPUCompareResult
x86Compute
(
virCPUDefPtr
host
,
virCPUDefPtr
cpu
,
union
cpuData
*
*
guest
,
virCPUDataPtr
*
guest
,
char
**
message
)
{
struct
x86_map
*
map
=
NULL
;
...
...
@@ -1303,7 +1303,7 @@ x86Compare(virCPUDefPtr host,
static
virCPUCompareResult
x86GuestData
(
virCPUDefPtr
host
,
virCPUDefPtr
guest
,
union
cpuData
*
*
data
,
virCPUDataPtr
*
data
,
char
**
message
)
{
return
x86Compute
(
host
,
guest
,
data
,
message
);
...
...
@@ -1413,7 +1413,7 @@ out:
static
int
x86DecodeCPUData
(
virCPUDefPtr
cpu
,
const
union
cpuData
*
data
,
const
virCPUDataPtr
data
,
const
char
**
models
,
unsigned
int
nmodels
,
const
char
*
preferred
)
...
...
@@ -1443,12 +1443,12 @@ x86EncodePolicy(const virCPUDefPtr cpu,
static
int
x86Encode
(
const
virCPUDefPtr
cpu
,
union
cpuData
*
*
forced
,
union
cpuData
*
*
required
,
union
cpuData
*
*
optional
,
union
cpuData
*
*
disabled
,
union
cpuData
*
*
forbidden
,
union
cpuData
*
*
vendor
)
virCPUDataPtr
*
forced
,
virCPUDataPtr
*
required
,
virCPUDataPtr
*
optional
,
virCPUDataPtr
*
disabled
,
virCPUDataPtr
*
forbidden
,
virCPUDataPtr
*
vendor
)
{
struct
x86_map
*
map
=
NULL
;
struct
cpuX86Data
*
data_forced
=
NULL
;
...
...
@@ -1628,10 +1628,10 @@ cpuidSet(uint32_t base, struct cpuX86cpuid **set)
}
static
union
cpuData
*
static
virCPUDataPtr
x86NodeData
(
void
)
{
union
cpuData
*
cpuData
=
NULL
;
virCPUDataPtr
cpuData
=
NULL
;
struct
cpuX86Data
*
data
;
int
ret
;
...
...
@@ -1872,7 +1872,7 @@ x86Update(virCPUDefPtr guest,
return
-
1
;
}
static
int
x86HasFeature
(
const
union
cpuData
*
data
,
static
int
x86HasFeature
(
const
virCPUDataPtr
data
,
const
char
*
name
)
{
struct
x86_map
*
map
;
...
...
src/qemu/qemu_capabilities.c
浏览文件 @
57d52b24
...
...
@@ -832,7 +832,7 @@ virQEMUCapsInitCPU(virCapsPtr caps,
virArch
arch
)
{
virCPUDefPtr
cpu
=
NULL
;
union
cpuData
*
data
=
NULL
;
virCPUDataPtr
data
=
NULL
;
virNodeInfo
nodeinfo
;
int
ret
=
-
1
;
...
...
src/qemu/qemu_command.c
浏览文件 @
57d52b24
...
...
@@ -5640,7 +5640,7 @@ qemuBuildCpuArgStr(const virQEMUDriverPtr driver,
size_t
ncpus
=
0
;
char
**
cpus
=
NULL
;
const
char
*
default_model
;
union
cpuData
*
data
=
NULL
;
virCPUDataPtr
data
=
NULL
;
bool
have_cpu
=
false
;
char
*
compare_msg
=
NULL
;
int
ret
=
-
1
;
...
...
@@ -9894,7 +9894,7 @@ qemuParseCommandLineCPU(virDomainDefPtr dom,
if
(
dom
->
os
.
arch
==
VIR_ARCH_X86_64
)
{
bool
is_32bit
=
false
;
if
(
cpu
)
{
union
cpuData
*
cpuData
=
NULL
;
virCPUDataPtr
cpuData
=
NULL
;
if
(
cpuEncode
(
VIR_ARCH_X86_64
,
cpu
,
NULL
,
&
cpuData
,
NULL
,
NULL
,
NULL
,
NULL
)
<
0
)
...
...
src/vmware/vmware_conf.c
浏览文件 @
57d52b24
...
...
@@ -56,7 +56,7 @@ vmwareCapsInit(void)
virCapsPtr
caps
=
NULL
;
virCapsGuestPtr
guest
=
NULL
;
virCPUDefPtr
cpu
=
NULL
;
union
cpuData
*
data
=
NULL
;
virCPUDataPtr
data
=
NULL
;
if
((
caps
=
virCapabilitiesNew
(
virArchFromHost
(),
0
,
0
))
==
NULL
)
...
...
tests/cputest.c
浏览文件 @
57d52b24
...
...
@@ -261,7 +261,7 @@ cpuTestGuestData(const void *arg)
virCPUDefPtr
host
=
NULL
;
virCPUDefPtr
cpu
=
NULL
;
virCPUDefPtr
guest
=
NULL
;
union
cpuData
*
guestData
=
NULL
;
virCPUDataPtr
guestData
=
NULL
;
virCPUCompareResult
cmpResult
;
virBuffer
buf
=
VIR_BUFFER_INITIALIZER
;
char
*
result
=
NULL
;
...
...
@@ -417,7 +417,7 @@ cpuTestHasFeature(const void *arg)
const
struct
data
*
data
=
arg
;
int
ret
=
-
1
;
virCPUDefPtr
host
=
NULL
;
union
cpuData
*
hostData
=
NULL
;
virCPUDataPtr
hostData
=
NULL
;
int
result
;
if
(
!
(
host
=
cpuTestLoadXML
(
data
->
arch
,
data
->
host
)))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录