提交 938368f8 编写于 作者: A Andrea Bolognani

qemu: Add conditions for qemu-kvm use on ppc64

qemu-kvm can be used to run ppc64 guests on ppc64le hosts and vice
versa, since the hardware is actually the same and the endianness
is chosen by the guest kernel.

Up until now, however, libvirt didn't allow the use of qemu-kvm
to run guests if their endianness didn't match the host's.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1267882
上级 9869f24d
...@@ -769,7 +769,7 @@ virQEMUCapsInitGuest(virCapsPtr caps, ...@@ -769,7 +769,7 @@ virQEMUCapsInitGuest(virCapsPtr caps,
char *binary = NULL; char *binary = NULL;
virQEMUCapsPtr qemubinCaps = NULL; virQEMUCapsPtr qemubinCaps = NULL;
virQEMUCapsPtr kvmbinCaps = NULL; virQEMUCapsPtr kvmbinCaps = NULL;
bool native_kvm, x86_32on64_kvm, arm_32on64_kvm; bool native_kvm, x86_32on64_kvm, arm_32on64_kvm, ppc64_kvm;
int ret = -1; int ret = -1;
/* Check for existence of base emulator, or alternate base /* Check for existence of base emulator, or alternate base
...@@ -789,14 +789,16 @@ virQEMUCapsInitGuest(virCapsPtr caps, ...@@ -789,14 +789,16 @@ virQEMUCapsInitGuest(virCapsPtr caps,
* - host & guest arches match * - host & guest arches match
* - hostarch is x86_64 and guest arch is i686 (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) * - hostarch is aarch64 and guest arch is armv7l (needs -cpu aarch64=off)
* - hostarch and guestarch are both ppc64*
*/ */
native_kvm = (hostarch == guestarch); native_kvm = (hostarch == guestarch);
x86_32on64_kvm = (hostarch == VIR_ARCH_X86_64 && x86_32on64_kvm = (hostarch == VIR_ARCH_X86_64 &&
guestarch == VIR_ARCH_I686); guestarch == VIR_ARCH_I686);
arm_32on64_kvm = (hostarch == VIR_ARCH_AARCH64 && arm_32on64_kvm = (hostarch == VIR_ARCH_AARCH64 &&
guestarch == VIR_ARCH_ARMV7L); guestarch == VIR_ARCH_ARMV7L);
ppc64_kvm = (ARCH_IS_PPC64(hostarch) && ARCH_IS_PPC64(guestarch));
if (native_kvm || x86_32on64_kvm || arm_32on64_kvm) { if (native_kvm || x86_32on64_kvm || arm_32on64_kvm || ppc64_kvm) {
const char *kvmbins[] = { const char *kvmbins[] = {
"/usr/libexec/qemu-kvm", /* RHEL */ "/usr/libexec/qemu-kvm", /* RHEL */
"qemu-kvm", /* Fedora */ "qemu-kvm", /* Fedora */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册