[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/37] monitor: Use accel_find("kvm") instead of kvm_available()
From: |
Peter Maydell |
Subject: |
[PULL 16/37] monitor: Use accel_find("kvm") instead of kvm_available() |
Date: |
Thu, 26 Aug 2021 18:02:46 +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 | 2 --
monitor/qmp-cmds.c | 2 +-
softmmu/arch_init.c | 9 ---------
3 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
index 7acfc62418f..57caad1c675 100644
--- a/include/sysemu/arch_init.h
+++ b/include/sysemu/arch_init.h
@@ -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 | \
diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index f7d64a64577..9ddb9352e65 100644
--- a/monitor/qmp-cmds.c
+++ b/monitor/qmp-cmds.c
@@ -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;
}
diff --git a/softmmu/arch_init.c b/softmmu/arch_init.c
index 3f4d7c1b1cd..9011af74e4a 100644
--- a/softmmu/arch_init.c
+++ b/softmmu/arch_init.c
@@ -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
-}
--
2.20.1
- [PULL 04/37] hw/dma/xlnx-zdma Always expect 'dma' link property to be set, (continued)
- [PULL 04/37] hw/dma/xlnx-zdma Always expect 'dma' link property to be set, Peter Maydell, 2021/08/26
- [PULL 08/37] target/arm/cpu64: Replace kvm_supported with sve_vq_supported, Peter Maydell, 2021/08/26
- [PULL 06/37] target/arm/cpu: Introduce sve_vq_supported bitmap, Peter Maydell, 2021/08/26
- [PULL 09/37] target/arm/cpu64: Validate sve vector lengths are supported, Peter Maydell, 2021/08/26
- [PULL 10/37] docs/specs/acpu_cpu_hotplug: Convert to rST, Peter Maydell, 2021/08/26
- [PULL 15/37] softmmu: Use accel_find("xen") instead of xen_available(), Peter Maydell, 2021/08/26
- [PULL 12/37] docs/specs/acpi_pci_hotplug: Convert to rST, Peter Maydell, 2021/08/26
- [PULL 14/37] MAINTAINERS: Add ACPI specs documents to ACPI and NVDIMM sections, Peter Maydell, 2021/08/26
- [PULL 13/37] docs/specs/acpi_nvdimm: Convert to rST, Peter Maydell, 2021/08/26
- [PULL 11/37] docs/specs/acpi_mem_hotplug: Convert to rST, Peter Maydell, 2021/08/26
- [PULL 16/37] monitor: Use accel_find("kvm") instead of kvm_available(),
Peter Maydell <=
- [PULL 17/37] softmmu/arch_init.c: Trim down include list, Peter Maydell, 2021/08/26
- [PULL 19/37] arch_init.h: Add QEMU_ARCH_HEXAGON, Peter Maydell, 2021/08/26
- [PULL 20/37] arch_init.h: Move QEMU_ARCH_VIRTIO_* to qdev-monitor.c, Peter Maydell, 2021/08/26
- [PULL 18/37] meson.build: Define QEMU_ARCH in config-target.h, Peter Maydell, 2021/08/26
- [PULL 22/37] stubs: Remove unused arch_type.c stub, Peter Maydell, 2021/08/26
- [PULL 21/37] arch_init.h: Don't include arch_init.h unnecessarily, Peter Maydell, 2021/08/26
- [PULL 24/37] softmmu/physmem.c: Remove unneeded NULL check in qemu_ram_alloc_from_fd(), Peter Maydell, 2021/08/26
- [PULL 23/37] hw/core/loader: In gunzip(), check index is in range before use, not after, Peter Maydell, 2021/08/26
- [PULL 26/37] net: Zero sockaddr_in in parse_host_port(), Peter Maydell, 2021/08/26
- [PULL 30/37] raspi: Use error_fatal for SoC realize errors, not error_abort, Peter Maydell, 2021/08/26