From: Philippe Mathieu-Daudé Date: Fri, 7 Mar 2025 15:02:23 +0000 (+0100) Subject: hw/virtio/virtio-mem: Remove CONFIG_DEVICES include X-Git-Tag: v10.0.0-rc0~8^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f410d702e4b4925e178cf1effa314e01323c488b;p=thirdparty%2Fqemu.git hw/virtio/virtio-mem: Remove CONFIG_DEVICES include Rather than checking ACPI availability at compile time by checking the CONFIG_ACPI definition from CONFIG_DEVICES, check at runtime via acpi_builtin(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Hildenbrand Reviewed-by: Pierrick Bouvier Message-Id: <20250307223949.54040-5-philmd@linaro.org> --- diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index 7b140add76..5f57eccbb6 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -28,7 +28,7 @@ #include "migration/misc.h" #include "hw/boards.h" #include "hw/qdev-properties.h" -#include CONFIG_DEVICES +#include "hw/acpi/acpi.h" #include "trace.h" static const VMStateDescription vmstate_virtio_mem_device_early; @@ -883,10 +883,8 @@ static uint64_t virtio_mem_get_features(VirtIODevice *vdev, uint64_t features, MachineState *ms = MACHINE(qdev_get_machine()); VirtIOMEM *vmem = VIRTIO_MEM(vdev); - if (ms->numa_state) { -#if defined(CONFIG_ACPI) + if (ms->numa_state && acpi_builtin()) { virtio_add_feature(&features, VIRTIO_MEM_F_ACPI_PXM); -#endif } assert(vmem->unplugged_inaccessible != ON_OFF_AUTO_AUTO); if (vmem->unplugged_inaccessible == ON_OFF_AUTO_ON) {