aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2021-10-28 16:57:35 +0200
committerPhilippe Mathieu-Daudé <philmd@redhat.com>2021-11-01 19:44:11 +0100
commit09112bef740853c9afd5318ecd0e93394648a3a6 (patch)
treebd564ad914495b2bb123da411e58542b02763a3c /hw
parent81c7b381558541531fa119e16a58098d6febbf5f (diff)
downloadqemu-09112bef740853c9afd5318ecd0e93394648a3a6.zip
qemu-09112bef740853c9afd5318ecd0e93394648a3a6.tar.gz
qemu-09112bef740853c9afd5318ecd0e93394648a3a6.tar.bz2
hw/core: Restrict hotplug to system emulation
Restrict hotplug to system emulation, add stubs for the other uses. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Yanan Wang <wangyanan55@huawei.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20211028150521.1973821-5-philmd@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/core/hotplug-stubs.c34
-rw-r--r--hw/core/meson.build12
2 files changed, 44 insertions, 2 deletions
diff --git a/hw/core/hotplug-stubs.c b/hw/core/hotplug-stubs.c
new file mode 100644
index 0000000..7aadaa2
--- /dev/null
+++ b/hw/core/hotplug-stubs.c
@@ -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();
+}
diff --git a/hw/core/meson.build b/hw/core/meson.build
index c9fe644..7ec7bb9 100644
--- a/hw/core/meson.build
+++ b/hw/core/meson.build
@@ -1,7 +1,6 @@
# core qdev-related obj files, also used by *-user and unit tests
hwcore_ss.add(files(
'bus.c',
- 'hotplug.c',
'qdev-properties.c',
'qdev.c',
'reset.c',
@@ -11,8 +10,17 @@ hwcore_ss.add(files(
'irq.c',
'clock.c',
'qdev-clock.c',
- 'qdev-hotplug.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'))
softmmu_ss.add(when: 'CONFIG_FITLOADER', if_true: files('loader-fit.c'))