monitor: Use accel_find("kvm") instead of kvm_available()
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 30 Jul 2021 10:59:41 +0000 (11:59 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 26 Aug 2021 16:02:00 +0000 (17:02 +0100)
The kvm_available() function reports whether KVM support was
compiled into the QEMU binary; it returns the value of the
CONFIG_KVM define.

The only place in the codebase where we use this function is
in qmp_query_kvm(). Now that accelerators are based on QOM
classes we can instead use accel_find("kvm") and remove the
kvm_available() function.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210730105947.28215-3-peter.maydell@linaro.org

include/sysemu/arch_init.h
monitor/qmp-cmds.c
softmmu/arch_init.c

index 7acfc62418fe659d219f04235749076f011a1d34..57caad1c67597ab9f77c79c0536888f1ced15e42 100644 (file)
@@ -29,8 +29,6 @@ enum {
 
 extern const uint32_t arch_type;
 
-int kvm_available(void);
-
 /* default virtio transport per architecture */
 #define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \
                               QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \
index f7d64a64577a6b49c0b7776c3215be2cef42bfd9..9ddb9352e65d4218a8fba35648b57ad7a2c71e5d 100644 (file)
@@ -58,7 +58,7 @@ KvmInfo *qmp_query_kvm(Error **errp)
     KvmInfo *info = g_malloc0(sizeof(*info));
 
     info->enabled = kvm_enabled();
-    info->present = kvm_available();
+    info->present = accel_find("kvm");
 
     return info;
 }
index 3f4d7c1b1cdbfe11c9f0f04ab709cf26c04b61ff..9011af74e4a6ae3ce5076866d0ef4e1f5029fa8c 100644 (file)
@@ -87,12 +87,3 @@ int graphic_depth = 32;
 #endif
 
 const uint32_t arch_type = QEMU_ARCH;
-
-int kvm_available(void)
-{
-#ifdef CONFIG_KVM
-    return 1;
-#else
-    return 0;
-#endif
-}