From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 06/36] hw/core: Remove transitional infrastructure from BusClass
Date: Fri, 2 Feb 2024 15:36:07 +0000 [thread overview]
Message-ID: <20240202153637.3710444-7-peter.maydell@linaro.org> (raw)
In-Reply-To: <20240202153637.3710444-1-peter.maydell@linaro.org>
BusClass currently has transitional infrastructure to support
subclasses which implement the legacy BusClass::reset method rather
than the Resettable interface. We have now removed all the users of
BusClass::reset in the tree, so we can remove the transitional
infrastructure.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Cédric Le Goater <clg@redhat.com>
Acked-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Tested-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-id: 20240119163512.3810301-6-peter.maydell@linaro.org
---
include/hw/qdev-core.h | 2 --
hw/core/bus.c | 67 ------------------------------------------
2 files changed, 69 deletions(-)
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 66338f479fe..d47536eadb1 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -329,8 +329,6 @@ struct BusClass {
*/
char *(*get_fw_dev_path)(DeviceState *dev);
- void (*reset)(BusState *bus);
-
/*
* Return whether the device can be added to @bus,
* based on the address that was set (via device properties)
diff --git a/hw/core/bus.c b/hw/core/bus.c
index c7831b5293b..b9d89495cdf 100644
--- a/hw/core/bus.c
+++ b/hw/core/bus.c
@@ -232,57 +232,6 @@ static char *default_bus_get_fw_dev_path(DeviceState *dev)
return g_strdup(object_get_typename(OBJECT(dev)));
}
-/**
- * bus_phases_reset:
- * Transition reset method for buses to allow moving
- * smoothly from legacy reset method to multi-phases
- */
-static void bus_phases_reset(BusState *bus)
-{
- ResettableClass *rc = RESETTABLE_GET_CLASS(bus);
-
- if (rc->phases.enter) {
- rc->phases.enter(OBJECT(bus), RESET_TYPE_COLD);
- }
- if (rc->phases.hold) {
- rc->phases.hold(OBJECT(bus));
- }
- if (rc->phases.exit) {
- rc->phases.exit(OBJECT(bus));
- }
-}
-
-static void bus_transitional_reset(Object *obj)
-{
- BusClass *bc = BUS_GET_CLASS(obj);
-
- /*
- * This will call either @bus_phases_reset (for multi-phases transitioned
- * buses) or a bus's specific method for not-yet transitioned buses.
- * In both case, it does not reset children.
- */
- if (bc->reset) {
- bc->reset(BUS(obj));
- }
-}
-
-/**
- * bus_get_transitional_reset:
- * check if the bus's class is ready for multi-phase
- */
-static ResettableTrFunction bus_get_transitional_reset(Object *obj)
-{
- BusClass *dc = BUS_GET_CLASS(obj);
- if (dc->reset != bus_phases_reset) {
- /*
- * dc->reset has been overridden by a subclass,
- * the bus is not ready for multi phase yet.
- */
- return bus_transitional_reset;
- }
- return NULL;
-}
-
static void bus_class_init(ObjectClass *class, void *data)
{
BusClass *bc = BUS_CLASS(class);
@@ -293,22 +242,6 @@ static void bus_class_init(ObjectClass *class, void *data)
rc->get_state = bus_get_reset_state;
rc->child_foreach = bus_reset_child_foreach;
-
- /*
- * @bus_phases_reset is put as the default reset method below, allowing
- * to do the multi-phase transition from base classes to leaf classes. It
- * allows a legacy-reset Bus class to extend a multi-phases-reset
- * Bus class for the following reason:
- * + If a base class B has been moved to multi-phase, then it does not
- * override this default reset method and may have defined phase methods.
- * + A child class C (extending class B) which uses
- * bus_class_set_parent_reset() (or similar means) to override the
- * reset method will still work as expected. @bus_phases_reset function
- * will be registered as the parent reset method and effectively call
- * parent reset phases.
- */
- bc->reset = bus_phases_reset;
- rc->get_transitional_function = bus_get_transitional_reset;
}
static void qbus_finalize(Object *obj)
--
2.34.1
next prev parent reply other threads:[~2024-02-02 15:37 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 15:36 [PULL 00/36] target-arm queue Peter Maydell
2024-02-02 15:36 ` [PULL 01/36] target/arm: fix exception syndrome for AArch32 bkpt insn Peter Maydell
2024-02-02 15:36 ` [PULL 02/36] pci: Switch bus reset to 3-phase-reset Peter Maydell
2024-02-02 15:36 ` [PULL 03/36] vmbus: " Peter Maydell
2024-02-02 15:36 ` [PULL 04/36] adb: " Peter Maydell
2024-02-02 15:36 ` [PULL 05/36] hw/s390x/css-bridge: switch virtual-css bus " Peter Maydell
2024-02-02 15:36 ` Peter Maydell [this message]
2024-02-02 15:36 ` [PULL 07/36] system/vl.c: Fix handling of '-serial none -serial something' Peter Maydell
2024-02-02 15:36 ` [PULL 08/36] qemu-options.hx: Improve -serial option documentation Peter Maydell
2024-02-02 15:36 ` [PULL 09/36] target/arm: Add ID_AA64ZFR0_EL1.B16B16 to the exposed-to-userspace set Peter Maydell
2024-02-02 15:36 ` [PULL 10/36] tests/qtest/xlnx-versal-trng-test.c: Drop use of variable length array Peter Maydell
2024-02-02 15:36 ` [PULL 11/36] target/arm: Reinstate "vfp" property on AArch32 CPUs Peter Maydell
2024-02-02 15:36 ` [PULL 12/36] doc/sphinx/hxtool.py: add optional label argument to SRST directive Peter Maydell
2024-02-02 15:36 ` [PULL 13/36] hw/arm/exynos: Add missing QOM parent for CPU cores Peter Maydell
2024-02-02 15:36 ` [PULL 14/36] hw/arm/exynos: Check for CPU types in machine_run_board_init() Peter Maydell
2024-02-02 15:36 ` [PULL 15/36] hw/arm/highbank: Add missing QOM parent for CPU cores Peter Maydell
2024-02-02 15:36 ` [PULL 16/36] hw/arm/highbank: Check for CPU types in machine_run_board_init() Peter Maydell
2024-02-02 15:36 ` [PULL 17/36] hw/arm/msf2: Simplify setting MachineClass::valid_cpu_types[] Peter Maydell
2024-02-02 15:36 ` [PULL 18/36] hw/arm/musca: " Peter Maydell
2024-02-02 15:36 ` [PULL 19/36] hw/arm/npcm7xx_boards: " Peter Maydell
2024-02-02 15:36 ` [PULL 20/36] hw/arm/vexpress: Check for CPU types in machine_run_board_init() Peter Maydell
2024-02-02 15:36 ` [PULL 21/36] hw/arm/zynq: " Peter Maydell
2024-02-02 15:36 ` [PULL 22/36] pci-host: designware: Limit value range of iATU viewport register Peter Maydell
2024-02-02 15:36 ` [PULL 23/36] hw/arm/strongarm.c: convert DPRINTF to trace events and guest errors Peter Maydell
2024-02-02 15:36 ` [PULL 24/36] hw/arm/z2: " Peter Maydell
2024-02-02 15:36 ` [PULL 25/36] hw/arm/xen_arm.c: convert DPRINTF to trace events and error/warn reports Peter Maydell
2024-02-02 15:36 ` [PULL 26/36] hw/xen/xen-mapcache.c: convert DPRINTF to tracepoints Peter Maydell
2024-02-02 15:36 ` [PULL 27/36] hw/xen/xen-hvm-common.c: " Peter Maydell
2024-02-02 15:36 ` [PULL 28/36] hw/xen: convert stderr prints to error/warn reports Peter Maydell
2024-02-02 15:36 ` [PULL 29/36] hw/net: Add NPCMXXX GMAC device Peter Maydell
2024-02-02 15:36 ` [PULL 30/36] hw/arm: Add GMAC devices to NPCM7XX SoC Peter Maydell
2024-02-02 15:36 ` [PULL 31/36] tests/qtest: Creating qtest for GMAC Module Peter Maydell
2024-02-02 15:36 ` [PULL 32/36] hw/net: GMAC Rx Implementation Peter Maydell
2024-02-02 15:36 ` [PULL 33/36] hw/net: GMAC Tx Implementation Peter Maydell
2024-03-08 13:54 ` Peter Maydell
2024-02-02 15:36 ` [PULL 34/36] tests/qtest: Adding PCS Module test to GMAC Qtest Peter Maydell
2024-02-02 15:36 ` [PULL 35/36] hw/ssi: Implement BCM2835 SPI Controller Peter Maydell
2024-02-02 15:36 ` [PULL 36/36] hw/arm: Connect SPI Controller to BCM2835 Peter Maydell
2024-02-03 13:27 ` [PULL 00/36] target-arm queue Peter Maydell
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=20240202153637.3710444-7-peter.maydell@linaro.org \
--to=peter.maydell@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).