memory-device: move stubs out of stubs/
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Apr 2024 15:53:26 +0000 (17:53 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 18 Apr 2024 09:17:27 +0000 (11:17 +0200)
Since the memory-device stubs are needed exactly when the Kconfig symbols are not
needed, move them to hw/mem/.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240408155330.522792-15-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/mem/memory-device-stubs.c [new file with mode: 0644]
hw/mem/meson.build
stubs/memory_device.c [deleted file]
stubs/meson.build

diff --git a/hw/mem/memory-device-stubs.c b/hw/mem/memory-device-stubs.c
new file mode 100644 (file)
index 0000000..15fd93f
--- /dev/null
@@ -0,0 +1,22 @@
+#include "qemu/osdep.h"
+#include "hw/mem/memory-device.h"
+
+MemoryDeviceInfoList *qmp_memory_device_list(void)
+{
+   return NULL;
+}
+
+uint64_t get_plugged_memory_size(void)
+{
+    return (uint64_t)-1;
+}
+
+unsigned int memory_devices_get_reserved_memslots(void)
+{
+    return 0;
+}
+
+bool memory_devices_memslot_auto_decision_active(void)
+{
+    return false;
+}
index faee1fe93604a44944937b5ae13480c96cc955e8..1c1c6da24b5fe8af8d6c65d21b2ed65f257a70af 100644 (file)
@@ -6,6 +6,7 @@ mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c'))
 mem_ss.add(when: 'CONFIG_CXL_MEM_DEVICE', if_true: files('cxl_type3.c'))
 system_ss.add(when: 'CONFIG_CXL_MEM_DEVICE', if_false: files('cxl_type3_stubs.c'))
 
+system_ss.add(when: 'CONFIG_MEM_DEVICE', if_false: files('memory-device-stubs.c'))
 system_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss)
 
 system_ss.add(when: 'CONFIG_SPARSE_MEM', if_true: files('sparse-mem.c'))
diff --git a/stubs/memory_device.c b/stubs/memory_device.c
deleted file mode 100644 (file)
index 15fd93f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "qemu/osdep.h"
-#include "hw/mem/memory-device.h"
-
-MemoryDeviceInfoList *qmp_memory_device_list(void)
-{
-   return NULL;
-}
-
-uint64_t get_plugged_memory_size(void)
-{
-    return (uint64_t)-1;
-}
-
-unsigned int memory_devices_get_reserved_memslots(void)
-{
-    return 0;
-}
-
-bool memory_devices_memslot_auto_decision_active(void)
-{
-    return false;
-}
index 92887660e41c605014195e80de93456f0f45403b..a4404e765ab105a3e1e412f4c84633b9462c51ca 100644 (file)
@@ -31,7 +31,6 @@ stub_ss.add(files('monitor.c'))
 stub_ss.add(files('monitor-core.c'))
 stub_ss.add(files('physmem.c'))
 stub_ss.add(files('qemu-timer-notify-cb.c'))
-stub_ss.add(files('memory_device.c'))
 stub_ss.add(files('qmp-command-available.c'))
 stub_ss.add(files('qmp-quit.c'))
 stub_ss.add(files('qtest.c'))