From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PULL 05/10] hw/core: Restrict hotplug to system emulation
Date: Mon, 1 Nov 2021 19:42:54 +0100 [thread overview]
Message-ID: <20211101184259.2859090-6-philmd@redhat.com> (raw)
In-Reply-To: <20211101184259.2859090-1-philmd@redhat.com>
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>
---
hw/core/hotplug-stubs.c | 34 ++++++++++++++++++++++++++++++++++
hw/core/meson.build | 12 ++++++++++--
2 files changed, 44 insertions(+), 2 deletions(-)
create mode 100644 hw/core/hotplug-stubs.c
diff --git a/hw/core/hotplug-stubs.c b/hw/core/hotplug-stubs.c
new file mode 100644
index 00000000000..7aadaa29bd5
--- /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 c9fe6441d92..7ec7bb93d5f 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 @@
'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'))
--
2.31.1
next prev parent reply other threads:[~2021-11-01 20:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-01 18:42 [PULL 00/10] Machine-next patches for 2021-11-01 Philippe Mathieu-Daudé
2021-11-01 18:42 ` [PULL 01/10] machine: Move gpio code to hw/core/gpio.c Philippe Mathieu-Daudé
2021-11-01 18:42 ` [PULL 02/10] hw/core: Restrict sysemu specific files Philippe Mathieu-Daudé
2021-11-01 18:42 ` [PULL 03/10] hw/core: Declare meson source set Philippe Mathieu-Daudé
2021-11-01 18:42 ` [PULL 04/10] hw/core: Extract hotplug-related functions to qdev-hotplug.c Philippe Mathieu-Daudé
2021-11-01 18:42 ` Philippe Mathieu-Daudé [this message]
2021-11-01 18:42 ` [PULL 06/10] hw/core/machine: Split out the smp parsing code Philippe Mathieu-Daudé
2021-11-01 18:42 ` [PULL 07/10] tests/unit: Add an unit test for smp parsing Philippe Mathieu-Daudé
2021-11-01 18:42 ` [PULL 08/10] machine: add device_type_is_dynamic_sysbus function Philippe Mathieu-Daudé
2021-11-01 18:42 ` [PULL 09/10] qdev-monitor: Check sysbus device type before creating it Philippe Mathieu-Daudé
2021-11-01 18:42 ` [PULL 10/10] machine: remove the done notifier for dynamic sysbus device type check Philippe Mathieu-Daudé
2021-11-02 11:24 ` [PULL 00/10] Machine-next patches for 2021-11-01 Richard Henderson
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=20211101184259.2859090-6-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wangyanan55@huawei.com \
/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).