提交 560335c3 编写于 作者: A Andrea Bolognani

qemu: Advertise ACPI support for aarch64 guests

So far, libvirt has assumed that only x86 supports ACPI,
but that's inaccurate since aarch64 supports it too.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1429509
上级 5fbb16ba
...@@ -1043,13 +1043,17 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, ...@@ -1043,13 +1043,17 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
machines = NULL; machines = NULL;
nmachines = 0; nmachines = 0;
}
if ((ARCH_IS_X86(guestarch) || guestarch == VIR_ARCH_AARCH64) &&
virCapabilitiesAddGuestFeature(guest, "acpi", true, true) == NULL) {
goto cleanup;
} }
if (ARCH_IS_X86(guestarch) && if (ARCH_IS_X86(guestarch) &&
(virCapabilitiesAddGuestFeature(guest, "acpi", true, true) == NULL || virCapabilitiesAddGuestFeature(guest, "apic", true, false) == NULL) {
virCapabilitiesAddGuestFeature(guest, "apic", true, false) == NULL))
goto cleanup; goto cleanup;
}
if ((guestarch == VIR_ARCH_I686) && if ((guestarch == VIR_ARCH_I686) &&
(virCapabilitiesAddGuestFeature(guest, "pae", true, false) == NULL || (virCapabilitiesAddGuestFeature(guest, "pae", true, false) == NULL ||
...@@ -4180,10 +4184,15 @@ virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid, const c ...@@ -4180,10 +4184,15 @@ virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid, const c
qmperr) < 0) qmperr) < 0)
goto cleanup; goto cleanup;
/* -no-acpi is not supported on non-x86 /* Older QEMU versions reported -no-acpi in the output of -help even
* even if qemu reports it in -help */ * though it was not supported by the architecture. The issue has since
if (!ARCH_IS_X86(qemuCaps->arch)) * been fixed, but to maintain compatibility with all release we still
* need to filter out the capability for architectures that we know
* don't support the feature, eg. anything but x86 and aarch64 */
if (!ARCH_IS_X86(qemuCaps->arch) &&
qemuCaps->arch != VIR_ARCH_AARCH64) {
virQEMUCapsClear(qemuCaps, QEMU_CAPS_NO_ACPI); virQEMUCapsClear(qemuCaps, QEMU_CAPS_NO_ACPI);
}
/* virQEMUCapsExtractDeviceStr will only set additional caps if qemu /* virQEMUCapsExtractDeviceStr will only set additional caps if qemu
* understands the 0.13.0+ notion of "-device driver,". */ * understands the 0.13.0+ notion of "-device driver,". */
...@@ -4304,9 +4313,14 @@ virQEMUCapsInitQMPArch(virQEMUCapsPtr qemuCaps, ...@@ -4304,9 +4313,14 @@ virQEMUCapsInitQMPArch(virQEMUCapsPtr qemuCaps,
void void
virQEMUCapsInitQMPBasicArch(virQEMUCapsPtr qemuCaps) virQEMUCapsInitQMPBasicArch(virQEMUCapsPtr qemuCaps)
{ {
/* ACPI/HPET/KVM PIT are x86 specific */ /* ACPI only works on x86 and aarch64 */
if (ARCH_IS_X86(qemuCaps->arch)) { if (ARCH_IS_X86(qemuCaps->arch) ||
qemuCaps->arch == VIR_ARCH_AARCH64) {
virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI); virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI);
}
/* HPET and KVM PIT are x86 specific */
if (ARCH_IS_X86(qemuCaps->arch)) {
virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_HPET); virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_HPET);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_KVM_PIT); virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_KVM_PIT);
} }
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<flag name='no-shutdown'/> <flag name='no-shutdown'/>
<flag name='cache-unsafe'/> <flag name='cache-unsafe'/>
<flag name='ich9-ahci'/> <flag name='ich9-ahci'/>
<flag name='no-acpi'/>
<flag name='fsdev-readonly'/> <flag name='fsdev-readonly'/>
<flag name='virtio-blk-pci.scsi'/> <flag name='virtio-blk-pci.scsi'/>
<flag name='drive-copy-on-read'/> <flag name='drive-copy-on-read'/>
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<flag name='no-shutdown'/> <flag name='no-shutdown'/>
<flag name='cache-unsafe'/> <flag name='cache-unsafe'/>
<flag name='ich9-ahci'/> <flag name='ich9-ahci'/>
<flag name='no-acpi'/>
<flag name='fsdev-readonly'/> <flag name='fsdev-readonly'/>
<flag name='virtio-blk-pci.scsi'/> <flag name='virtio-blk-pci.scsi'/>
<flag name='drive-copy-on-read'/> <flag name='drive-copy-on-read'/>
......
...@@ -15,4 +15,5 @@ QEMU_AUDIO_DRV=none \ ...@@ -15,4 +15,5 @@ QEMU_AUDIO_DRV=none \
-nographic \ -nographic \
-nodefaults \ -nodefaults \
-monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
-no-acpi \
-boot c -boot c
...@@ -15,4 +15,5 @@ QEMU_AUDIO_DRV=none \ ...@@ -15,4 +15,5 @@ QEMU_AUDIO_DRV=none \
-nographic \ -nographic \
-nodefaults \ -nodefaults \
-monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
-no-acpi \
-boot c -boot c
...@@ -15,4 +15,5 @@ QEMU_AUDIO_DRV=none \ ...@@ -15,4 +15,5 @@ QEMU_AUDIO_DRV=none \
-nographic \ -nographic \
-nodefaults \ -nodefaults \
-monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \ -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
-no-acpi \
-boot c -boot c
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册