Message ID | 20220223090706.4888-10-damien.hedde@greensocs.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Initial support for machine creation via QMP | expand |
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 <damien.hedde@greensocs.com> > --- > hw/core/null-machine.c | 4 ++++ > 1 file changed, 4 insertions(+) Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Jim Shu <jim.shu@sifive.com> On Thu, Mar 3, 2022 at 10:46 PM Philippe Mathieu-Daudé < philippe.mathieu.daude@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 <damien.hedde@greensocs.com> > > --- > > hw/core/null-machine.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > >
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 = {
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(+)