]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Advertise ACPI support for aarch64 guests
authorAndrea Bolognani <abologna@redhat.com>
Thu, 2 Mar 2017 17:57:51 +0000 (18:57 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 3 Apr 2017 08:58:00 +0000 (10:58 +0200)
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

src/qemu/qemu_capabilities.c
tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml
tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-host.args
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.args
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.args

index 3c994954d66fd8268b02965ab8a2facf6441535f..a2f4f43e65bfccdc9764f2e63afdea3cc4ecbc00 100644 (file)
@@ -1043,13 +1043,17 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
 
         machines = NULL;
         nmachines = 0;
+    }
 
+    if ((ARCH_IS_X86(guestarch) || guestarch == VIR_ARCH_AARCH64) &&
+        virCapabilitiesAddGuestFeature(guest, "acpi", true, true) == NULL) {
+        goto cleanup;
     }
 
     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;
+    }
 
     if ((guestarch == VIR_ARCH_I686) &&
         (virCapabilitiesAddGuestFeature(guest, "pae", true, false) == NULL ||
@@ -4180,10 +4184,15 @@ virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t runUid, gid_t runGid, const c
                                 qmperr) < 0)
         goto cleanup;
 
-    /* -no-acpi is not supported on non-x86
-     * even if qemu reports it in -help */
-    if (!ARCH_IS_X86(qemuCaps->arch))
+    /* Older QEMU versions reported -no-acpi in the output of -help even
+     * though it was not supported by the architecture. The issue has since
+     * 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);
+    }
 
     /* virQEMUCapsExtractDeviceStr will only set additional caps if qemu
      * understands the 0.13.0+ notion of "-device driver,".  */
@@ -4304,9 +4313,14 @@ virQEMUCapsInitQMPArch(virQEMUCapsPtr qemuCaps,
 void
 virQEMUCapsInitQMPBasicArch(virQEMUCapsPtr qemuCaps)
 {
-    /* ACPI/HPET/KVM PIT are x86 specific */
-    if (ARCH_IS_X86(qemuCaps->arch)) {
+    /* ACPI only works on x86 and aarch64 */
+    if (ARCH_IS_X86(qemuCaps->arch) ||
+        qemuCaps->arch == VIR_ARCH_AARCH64) {
         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_KVM_PIT);
     }
index c1e46794aeebe5118fff77aeb46dc7665dc0a3ff..af3a8e7cb367458813ed04fbaea08f3eddd7673f 100644 (file)
@@ -40,6 +40,7 @@
   <flag name='no-shutdown'/>
   <flag name='cache-unsafe'/>
   <flag name='ich9-ahci'/>
+  <flag name='no-acpi'/>
   <flag name='fsdev-readonly'/>
   <flag name='virtio-blk-pci.scsi'/>
   <flag name='drive-copy-on-read'/>
index 20dfda2161ad909f1fa1b1e301df3f38affa0cec..4402ffa6fbb6da60667971e0d116ad65cf54986e 100644 (file)
@@ -40,6 +40,7 @@
   <flag name='no-shutdown'/>
   <flag name='cache-unsafe'/>
   <flag name='ich9-ahci'/>
+  <flag name='no-acpi'/>
   <flag name='fsdev-readonly'/>
   <flag name='virtio-blk-pci.scsi'/>
   <flag name='drive-copy-on-read'/>
index 5fdaa08ef19900576e7d7d396ee53dacc19ed59c..23276ad71a20e25a451a5a8699f60788fbeea607 100644 (file)
@@ -15,4 +15,5 @@ QEMU_AUDIO_DRV=none \
 -nographic \
 -nodefaults \
 -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
+-no-acpi \
 -boot c
index 2caf1b92cc463c020460fc7a1001a28d2f4296db..f79c1c60e9a4f0a48928d760968314bcf1da9281 100644 (file)
@@ -15,4 +15,5 @@ QEMU_AUDIO_DRV=none \
 -nographic \
 -nodefaults \
 -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
+-no-acpi \
 -boot c
index 3ae8e5f86e4193a60c26468c63cd37fefd8f8f5c..fce9308b01e872427a10254dca86c92b91375cce 100644 (file)
@@ -15,4 +15,5 @@ QEMU_AUDIO_DRV=none \
 -nographic \
 -nodefaults \
 -monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
+-no-acpi \
 -boot c