[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 09/14] none-machine: allow cold plugging sysbus devices
From: |
Damien Hedde |
Subject: |
[PATCH v4 09/14] none-machine: allow cold plugging sysbus devices |
Date: |
Wed, 23 Feb 2022 10:07:01 +0100 |
Allow plugging any sysbus device on this machine (the sysbus
devices still need to be 'user-creatable').
This commit is needed to use the 'none' machine as a base, and
subsequently to dynamically populate it with sysbus devices using
qapi commands.
Note that this only concern cold-plug: sysbus devices cann't be hot
plugged because the sysbus bus does not support it.
Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
---
hw/core/null-machine.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
index 5fd1cc0218..702b56232d 100644
--- a/hw/core/null-machine.c
+++ b/hw/core/null-machine.c
@@ -17,6 +17,7 @@
#include "exec/address-spaces.h"
#include "hw/core/cpu.h"
#include "qapi/visitor.h"
+#include "hw/sysbus.h"
struct NoneMachineState {
MachineState parent;
@@ -93,6 +94,9 @@ static void machine_none_class_init(ObjectClass *oc, void
*data)
NULL, NULL);
object_class_property_set_description(oc, "ram-addr",
"Base address of the RAM (default is 0)");
+
+ /* allow cold plugging any any "user-creatable" sysbus device */
+ machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SYS_BUS_DEVICE);
}
static const TypeInfo none_machine_info = {
--
2.35.1
- [PATCH v4 05/14] qapi/device_add: handle the rom_order_override when cold-plugging, (continued)
- [PATCH v4 05/14] qapi/device_add: handle the rom_order_override when cold-plugging, Damien Hedde, 2022/02/23
- [PATCH v4 10/14] none-machine: allow several cpus, Damien Hedde, 2022/02/23
- [PATCH v4 08/14] none-machine: add 'ram-addr' property, Damien Hedde, 2022/02/23
- [PATCH v4 02/14] machine&vl: introduce phase_until() to handle phase transitions, Damien Hedde, 2022/02/23
- [PATCH v4 06/14] qapi/device_add: Allow execution in machine initialized phase, Damien Hedde, 2022/02/23
- [PATCH v4 07/14] none-machine: add the NoneMachineState structure, Damien Hedde, 2022/02/23
- [PATCH v4 01/14] machine: add phase_get() and document phase_check()/advance(), Damien Hedde, 2022/02/23
- [PATCH v4 03/14] vl: support machine-initialized target in phase_until(), Damien Hedde, 2022/02/23
- [PATCH v4 12/14] add sysbus-mmio-map qapi command, Damien Hedde, 2022/02/23
- [PATCH v4 04/14] qapi/device_add: compute is_hotplug flag, Damien Hedde, 2022/02/23
- [PATCH v4 09/14] none-machine: allow cold plugging sysbus devices,
Damien Hedde <=
- [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Damien Hedde, 2022/02/23
- Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Igor Mammedov, 2022/02/23
- Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Damien Hedde, 2022/02/23
- Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Igor Mammedov, 2022/02/24
- Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Damien Hedde, 2022/02/24
- Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Igor Mammedov, 2022/02/25
- Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Damien Hedde, 2022/02/25
[PATCH v4 11/14] softmmu/memory: add memory_region_try_add_subregion function, Damien Hedde, 2022/02/23
[PATCH v4 14/14] hw: set user_creatable on opentitan/sifive_e devices, Damien Hedde, 2022/02/23