Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
122d6118
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,发现更多精彩内容 >>
提交
122d6118
编写于
4月 07, 2017
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "qemu: Move qemuCaps->{kvm,tcg}CPUModel into a struct"
This reverts commit
68507d77
which was pushed accidentally.
上级
9ad3cd16
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
39 deletion
+26
-39
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.c
+26
-39
未找到文件。
src/qemu/qemu_capabilities.c
浏览文件 @
122d6118
...
...
@@ -414,10 +414,8 @@ struct _virQEMUCaps {
* re-computed from the other fields or external data sources every
* time we probe QEMU or load the results from the cache.
*/
struct
{
virCPUDefPtr
kvm
;
virCPUDefPtr
tcg
;
}
hostCPU
;
virCPUDefPtr
kvmCPUModel
;
virCPUDefPtr
tcgCPUModel
;
};
struct
virQEMUCapsSearchData
{
...
...
@@ -2088,31 +2086,6 @@ virQEMUCapsNew(void)
}
static
int
virQEMUCapsCopyHostCPUData
(
virQEMUCapsPtr
dst
,
virQEMUCapsPtr
src
)
{
if
(
src
->
kvmCPUModelInfo
&&
!
(
dst
->
kvmCPUModelInfo
=
qemuMonitorCPUModelInfoCopy
(
src
->
kvmCPUModelInfo
)))
return
-
1
;
if
(
src
->
tcgCPUModelInfo
&&
!
(
dst
->
tcgCPUModelInfo
=
qemuMonitorCPUModelInfoCopy
(
src
->
tcgCPUModelInfo
)))
return
-
1
;
if
(
src
->
hostCPU
.
kvm
&&
!
(
dst
->
hostCPU
.
kvm
=
virCPUDefCopy
(
src
->
hostCPU
.
kvm
)))
return
-
1
;
if
(
src
->
hostCPU
.
tcg
&&
!
(
dst
->
hostCPU
.
tcg
=
virCPUDefCopy
(
src
->
hostCPU
.
tcg
)))
return
-
1
;
return
0
;
}
virQEMUCapsPtr
virQEMUCapsNewCopy
(
virQEMUCapsPtr
qemuCaps
)
{
virQEMUCapsPtr
ret
=
virQEMUCapsNew
();
...
...
@@ -2150,7 +2123,20 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps)
goto
error
;
}
if
(
virQEMUCapsCopyHostCPUData
(
ret
,
qemuCaps
)
<
0
)
if
(
qemuCaps
->
kvmCPUModel
&&
!
(
ret
->
kvmCPUModel
=
virCPUDefCopy
(
qemuCaps
->
kvmCPUModel
)))
goto
error
;
if
(
qemuCaps
->
tcgCPUModel
&&
!
(
ret
->
tcgCPUModel
=
virCPUDefCopy
(
qemuCaps
->
tcgCPUModel
)))
goto
error
;
if
(
qemuCaps
->
kvmCPUModelInfo
&&
!
(
ret
->
kvmCPUModelInfo
=
qemuMonitorCPUModelInfoCopy
(
qemuCaps
->
kvmCPUModelInfo
)))
goto
error
;
if
(
qemuCaps
->
tcgCPUModelInfo
&&
!
(
ret
->
tcgCPUModelInfo
=
qemuMonitorCPUModelInfoCopy
(
qemuCaps
->
tcgCPUModelInfo
)))
goto
error
;
if
(
VIR_ALLOC_N
(
ret
->
machineTypes
,
qemuCaps
->
nmachineTypes
)
<
0
)
...
...
@@ -2201,8 +2187,8 @@ void virQEMUCapsDispose(void *obj)
qemuMonitorCPUModelInfoFree
(
qemuCaps
->
kvmCPUModelInfo
);
qemuMonitorCPUModelInfoFree
(
qemuCaps
->
tcgCPUModelInfo
);
virCPUDefFree
(
qemuCaps
->
hostCPU
.
kvm
);
virCPUDefFree
(
qemuCaps
->
hostCPU
.
tcg
);
virCPUDefFree
(
qemuCaps
->
kvmCPUModel
);
virCPUDefFree
(
qemuCaps
->
tcgCPUModel
);
}
void
...
...
@@ -2431,9 +2417,9 @@ virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps,
virDomainVirtType
type
)
{
if
(
type
==
VIR_DOMAIN_VIRT_KVM
)
return
qemuCaps
->
hostCPU
.
kvm
;
return
qemuCaps
->
kvmCPUModel
;
else
return
qemuCaps
->
hostCPU
.
tcg
;
return
qemuCaps
->
tcgCPUModel
;
}
...
...
@@ -3314,9 +3300,9 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
}
if
(
type
==
VIR_DOMAIN_VIRT_KVM
)
qemuCaps
->
hostCPU
.
kvm
=
cpu
;
qemuCaps
->
kvmCPUModel
=
cpu
;
else
qemuCaps
->
hostCPU
.
tcg
=
cpu
;
qemuCaps
->
tcgCPUModel
=
cpu
;
cleanup:
virCPUDefFree
(
hostCPU
);
...
...
@@ -4071,9 +4057,10 @@ virQEMUCapsReset(virQEMUCapsPtr qemuCaps)
qemuCaps
->
kvmCPUModelInfo
=
NULL
;
qemuCaps
->
tcgCPUModelInfo
=
NULL
;
virCPUDefFree
(
qemuCaps
->
hostCPU
.
kvm
);
virCPUDefFree
(
qemuCaps
->
hostCPU
.
tcg
);
memset
(
&
qemuCaps
->
hostCPU
,
0
,
sizeof
(
qemuCaps
->
hostCPU
));
virCPUDefFree
(
qemuCaps
->
kvmCPUModel
);
virCPUDefFree
(
qemuCaps
->
tcgCPUModel
);
qemuCaps
->
kvmCPUModel
=
NULL
;
qemuCaps
->
tcgCPUModel
=
NULL
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录