Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
daf2f514
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看板
提交
daf2f514
编写于
5月 21, 2015
作者:
C
Cole Robinson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: caps: Advertise arm 32-on-64 KVM option
We need to use qemu-system-aarch64 to run armv7l KVM VMs on an aarch64 host.
上级
667370d6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
20 deletion
+30
-20
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.c
+30
-20
未找到文件。
src/qemu/qemu_capabilities.c
浏览文件 @
daf2f514
...
...
@@ -723,19 +723,6 @@ virQEMUCapsFindBinaryForArch(virArch hostarch,
return
ret
;
}
static
bool
virQEMUCapsIsValidForKVM
(
virArch
hostarch
,
virArch
guestarch
)
{
if
(
hostarch
==
guestarch
)
return
true
;
if
(
hostarch
==
VIR_ARCH_X86_64
&&
guestarch
==
VIR_ARCH_I686
)
return
true
;
return
false
;
}
static
int
virQEMUCapsInitGuest
(
virCapsPtr
caps
,
virQEMUCapsCachePtr
cache
,
...
...
@@ -747,6 +734,7 @@ virQEMUCapsInitGuest(virCapsPtr caps,
char
*
binary
=
NULL
;
virQEMUCapsPtr
qemubinCaps
=
NULL
;
virQEMUCapsPtr
kvmbinCaps
=
NULL
;
bool
native_kvm
,
x86_32on64_kvm
,
arm_32on64_kvm
;
int
ret
=
-
1
;
/* Check for existence of base emulator, or alternate base
...
...
@@ -764,16 +752,38 @@ virQEMUCapsInitGuest(virCapsPtr caps,
/* qemu-kvm/kvm binaries can only be used if
* - host & guest arches match
* Or
* - hostarch is x86_64 and guest arch is i686
* The latter simply needs "-cpu qemu32"
* - hostarch is x86_64 and guest arch is i686 (needs -cpu qemu32)
* - hostarch is aarch64 and guest arch is armv7l (needs -cpu aarch64=off)
*/
if
(
virQEMUCapsIsValidForKVM
(
hostarch
,
guestarch
))
{
const
char
*
const
kvmbins
[]
=
{
"/usr/libexec/qemu-kvm"
,
/* RHEL */
"qemu-kvm"
,
/* Fedora */
"kvm"
};
/* Upstream .spec */
native_kvm
=
(
hostarch
==
guestarch
);
x86_32on64_kvm
=
(
hostarch
==
VIR_ARCH_X86_64
&&
guestarch
==
VIR_ARCH_I686
);
arm_32on64_kvm
=
(
hostarch
==
VIR_ARCH_AARCH64
&&
guestarch
==
VIR_ARCH_ARMV7L
);
if
(
native_kvm
||
x86_32on64_kvm
||
arm_32on64_kvm
)
{
const
char
*
kvmbins
[]
=
{
"/usr/libexec/qemu-kvm"
,
/* RHEL */
"qemu-kvm"
,
/* Fedora */
"kvm"
,
/* Debian/Ubuntu */
NULL
,
};
/* x86 32-on-64 can be used with qemu-system-i386 and
* qemu-system-x86_64, so if we don't find a specific kvm binary,
* we can just fall back to the host arch native binary and
* everything works fine.
*
* arm is different in that 32-on-64 _only_ works with
* qemu-system-aarch64. So we have to add it to the kvmbins list
*/
if
(
arm_32on64_kvm
)
kvmbins
[
3
]
=
"qemu-system-aarch64"
;
for
(
i
=
0
;
i
<
ARRAY_CARDINALITY
(
kvmbins
);
++
i
)
{
if
(
!
kvmbins
[
i
])
continue
;
kvmbin
=
virFindFileInPath
(
kvmbins
[
i
]);
if
(
!
kvmbin
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录