Re: [PATCH v4 09/14] none-machine: allow cold plugging sysbus devices
Tested-by: Jim Shu On Thu, Mar 3, 2022 at 10:46 PM Philippe Mathieu-Daudé < philippe.mathieu.da...@gmail.com> wrote: > On 23/2/22 10:07, Damien Hedde wrote: > > 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 > > "can not" is easier to understand for non-native / not good level of > English speakers IMHO. > > > plugged because the sysbus bus does not support it. > > > > Signed-off-by: Damien Hedde > > --- > > hw/core/null-machine.c | 4 > > 1 file changed, 4 insertions(+) > > Reviewed-by: Philippe Mathieu-Daudé > >
Re: [PATCH v4 09/14] none-machine: allow cold plugging sysbus devices
On 23/2/22 10:07, Damien Hedde wrote: 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 "can not" is easier to understand for non-native / not good level of English speakers IMHO. plugged because the sysbus bus does not support it. Signed-off-by: Damien Hedde --- hw/core/null-machine.c | 4 1 file changed, 4 insertions(+) Reviewed-by: Philippe Mathieu-Daudé
[PATCH v4 09/14] none-machine: allow cold plugging sysbus devices
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 --- 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