qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"David Hildenbrand" <david@redhat.com>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>
Subject: [PULL 12/14] hw/virtio/virtio-mem: Remove CONFIG_DEVICES include
Date: Tue, 11 Mar 2025 20:51:21 +0100	[thread overview]
Message-ID: <20250311195123.94212-13-philmd@linaro.org> (raw)
In-Reply-To: <20250311195123.94212-1-philmd@linaro.org>

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é <philmd@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20250307223949.54040-5-philmd@linaro.org>
---
 hw/virtio/virtio-mem.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index 7b140add765..5f57eccbb66 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) {
-- 
2.47.1



  parent reply	other threads:[~2025-03-11 19:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11 19:51 [PULL 00/14] Misc HW patches for 2025-03-11 Philippe Mathieu-Daudé
2025-03-11 19:51 ` [PULL 01/14] hw/sd/sdhci: Set reset value of interrupt registers Philippe Mathieu-Daudé
2025-03-11 19:51 ` [PULL 02/14] hw/rtc: Add Ricoh RS5C372 RTC emulation Philippe Mathieu-Daudé
2025-03-11 19:51 ` [PULL 03/14] hw/net/smc91c111: Sanitize packet numbers Philippe Mathieu-Daudé
2025-03-11 19:51 ` [PULL 04/14] hw/net/smc91c111: Sanitize packet length on tx Philippe Mathieu-Daudé
2025-03-11 19:51 ` [PULL 05/14] hw/net/smc91c111: Use MAX_PACKET_SIZE instead of magic numbers Philippe Mathieu-Daudé
2025-03-11 19:51 ` [PULL 06/14] hw/net/smc91c111: Don't allow data register access to overrun buffer Philippe Mathieu-Daudé
2025-03-11 19:51 ` [PULL 07/14] hw/xen/hvm: Fix Aarch64 typo Philippe Mathieu-Daudé
2025-03-11 19:51 ` [PULL 08/14] system: Extract target-specific globals to their own compilation unit Philippe Mathieu-Daudé
2025-03-11 19:51 ` [PULL 09/14] system: Replace arch_type global by qemu_arch_available() helper Philippe Mathieu-Daudé
2025-03-11 19:51 ` [PULL 10/14] hw/acpi: Introduce acpi_builtin() helper Philippe Mathieu-Daudé
2025-03-11 19:51 ` [PULL 11/14] hw/i386/fw_cfg: Check ACPI availability with acpi_builtin() Philippe Mathieu-Daudé
2025-03-11 19:51 ` Philippe Mathieu-Daudé [this message]
2025-03-11 19:51 ` [PULL 13/14] hw/hyperv/hyperv-proto: Move SYNDBG definitions from target/i386 Philippe Mathieu-Daudé
2025-03-11 19:51 ` [PULL 14/14] hw/sd/sdhci: Remove need for SDHCI_VENDOR_FSL definition Philippe Mathieu-Daudé
2025-03-11 21:00   ` BALATON Zoltan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250311195123.94212-13-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=david@redhat.com \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).