Skip to content

Commit f410d70

Browse files
committed
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é <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Reviewed-by: Pierrick Bouvier <[email protected]> Message-Id: <[email protected]>
1 parent bb99b92 commit f410d70

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

hw/virtio/virtio-mem.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "migration/misc.h"
2929
#include "hw/boards.h"
3030
#include "hw/qdev-properties.h"
31-
#include CONFIG_DEVICES
31+
#include "hw/acpi/acpi.h"
3232
#include "trace.h"
3333

3434
static const VMStateDescription vmstate_virtio_mem_device_early;
@@ -883,10 +883,8 @@ static uint64_t virtio_mem_get_features(VirtIODevice *vdev, uint64_t features,
883883
MachineState *ms = MACHINE(qdev_get_machine());
884884
VirtIOMEM *vmem = VIRTIO_MEM(vdev);
885885

886-
if (ms->numa_state) {
887-
#if defined(CONFIG_ACPI)
886+
if (ms->numa_state && acpi_builtin()) {
888887
virtio_add_feature(&features, VIRTIO_MEM_F_ACPI_PXM);
889-
#endif
890888
}
891889
assert(vmem->unplugged_inaccessible != ON_OFF_AUTO_AUTO);
892890
if (vmem->unplugged_inaccessible == ON_OFF_AUTO_ON) {

0 commit comments

Comments
 (0)