hw/core: Move system emulation files to system_ss
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Apr 2024 15:53:19 +0000 (17:53 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 18 Apr 2024 09:17:27 +0000 (11:17 +0200)
hotplug.c, qdev-hotplug.c and reset.c are not used by user emulation
and need not be included in hwcore_ss.  Move them to system_ss, where
they belong, by letting the linker pull in the stubs when needed.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240408155330.522792-8-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/core/hotplug-stubs.c [deleted file]
hw/core/meson.build
stubs/hotplug-stubs.c [new file with mode: 0644]
stubs/meson.build

diff --git a/hw/core/hotplug-stubs.c b/hw/core/hotplug-stubs.c
deleted file mode 100644 (file)
index 7aadaa2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Hotplug handler stubs
- *
- * Copyright (c) Red Hat
- *
- * Authors:
- *  Philippe Mathieu-Daudé <philmd@redhat.com>,
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- */
-#include "qemu/osdep.h"
-#include "hw/qdev-core.h"
-
-HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev)
-{
-    return NULL;
-}
-
-void hotplug_handler_pre_plug(HotplugHandler *plug_handler,
-                              DeviceState *plugged_dev,
-                              Error **errp)
-{
-    g_assert_not_reached();
-}
-
-void hotplug_handler_plug(HotplugHandler *plug_handler,
-                          DeviceState *plugged_dev,
-                          Error **errp)
-{
-    g_assert_not_reached();
-}
index e26f2e088c32f73a821792400be7b174b946441a..f20d4143f7ac8264bffa70f73419d60b51756443 100644 (file)
@@ -3,7 +3,6 @@ hwcore_ss.add(files(
   'bus.c',
   'qdev-properties.c',
   'qdev.c',
-  'reset.c',
   'resetcontainer.c',
   'resettable.c',
   'vmstate-if.c',
@@ -12,16 +11,6 @@ hwcore_ss.add(files(
   'clock.c',
   'qdev-clock.c',
 ))
-if have_system
-  hwcore_ss.add(files(
-    'hotplug.c',
-    'qdev-hotplug.c',
-  ))
-else
-  hwcore_ss.add(files(
-    'hotplug-stubs.c',
-  ))
-endif
 
 common_ss.add(files('cpu-common.c'))
 common_ss.add(files('machine-smp.c'))
@@ -40,6 +29,7 @@ system_ss.add(files(
   'cpu-sysemu.c',
   'fw-path-provider.c',
   'gpio.c',
+  'hotplug.c',
   'loader.c',
   'machine-hmp-cmds.c',
   'machine-qmp-cmds.c',
@@ -48,7 +38,9 @@ system_ss.add(files(
   'null-machine.c',
   'numa.c',
   'qdev-fw.c',
+  'qdev-hotplug.c',
   'qdev-properties-system.c',
+  'reset.c',
   'sysbus.c',
   'vm-change-state-handler.c',
   'clock-vmstate.c',
diff --git a/stubs/hotplug-stubs.c b/stubs/hotplug-stubs.c
new file mode 100644 (file)
index 0000000..7aadaa2
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Hotplug handler stubs
+ *
+ * Copyright (c) Red Hat
+ *
+ * Authors:
+ *  Philippe Mathieu-Daudé <philmd@redhat.com>,
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#include "qemu/osdep.h"
+#include "hw/qdev-core.h"
+
+HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev)
+{
+    return NULL;
+}
+
+void hotplug_handler_pre_plug(HotplugHandler *plug_handler,
+                              DeviceState *plugged_dev,
+                              Error **errp)
+{
+    g_assert_not_reached();
+}
+
+void hotplug_handler_plug(HotplugHandler *plug_handler,
+                          DeviceState *plugged_dev,
+                          Error **errp)
+{
+    g_assert_not_reached();
+}
index 0bf25e6ca539583c8921c30b702952190f63670b..f87f5c1110fb70210e5bf2d73bdd72d7cfca9fc1 100644 (file)
@@ -14,6 +14,7 @@ stub_ss.add(files('fdset.c'))
 stub_ss.add(files('gdbstub.c'))
 stub_ss.add(files('get-vm-name.c'))
 stub_ss.add(files('graph-lock.c'))
+stub_ss.add(files('hotplug-stubs.c'))
 if linux_io_uring.found()
   stub_ss.add(files('io_uring.c'))
 endif