mbox series

[0/2] Set user creatable for flag ibex uart and plic

Message ID 20210811093838.18719-1-damien.hedde@greensocs.com (mailing list archive)
Headers show
Series Set user creatable for flag ibex uart and plic | expand

Message

Damien Hedde Aug. 11, 2021, 9:38 a.m. UTC
Hi,

This small series only consist in setting the user_creatable flag
of ibex_uart and ibex_plic devices. These two devices are already
using properties to configure themselves so nothing else is required.

Note that this change alone will not allow creation of these devices
using -device cli option or device_add qmp command as they are sysbus
devices.

We do that because we are currently working on adding the possibily
to configure/build a machine from qmp commands (see this rfc:
https://lists.gnu.org/archive/html/qemu-devel/2021-05/msg03706.html). 
We are using these simple devices in order to test our additions.

We prefer to send these 2 patches on a separate series as they are not
really related to the main topic. We will send a following series
for the additions.

Thanks,
Damien

Damien Hedde (2):
  hw/char/ibex_uart: set user-creatable
  hw/char/ibex_plic: set user-creatable

 hw/char/ibex_uart.c | 1 +
 hw/intc/ibex_plic.c | 1 +
 2 files changed, 2 insertions(+)

Comments

Peter Maydell Aug. 11, 2021, 11:15 a.m. UTC | #1
On Wed, 11 Aug 2021 at 10:43, Damien Hedde <damien.hedde@greensocs.com> wrote:
> This small series only consist in setting the user_creatable flag
> of ibex_uart and ibex_plic devices. These two devices are already
> using properties to configure themselves so nothing else is required.
>
> Note that this change alone will not allow creation of these devices
> using -device cli option or device_add qmp command as they are sysbus
> devices.
>
> We do that because we are currently working on adding the possibily
> to configure/build a machine from qmp commands (see this rfc:
> https://lists.gnu.org/archive/html/qemu-devel/2021-05/msg03706.html).
> We are using these simple devices in order to test our additions.
>
> We prefer to send these 2 patches on a separate series as they are not
> really related to the main topic. We will send a following series
> for the additions.

No, these patches should go in with your other series that
requires them, please. As standalone patches they are definitely
wrong, because (as you note) you cannot usefully user-create a
sysbus device like these from the command line.

Even there I'm not convinced that just marking the devices
user-creatable is the right thing -- if we support creating
a complete machine from QMP commands we probably want to think
about whether that means we need to have separate categories
of "only creatable from C code", "only creatable as part of
QMP machine creation", "creatable on commandline but only
for cold-plug", and "hotpluggable".

-- PMM
Damien Hedde Aug. 11, 2021, 11:48 a.m. UTC | #2
On 8/11/21 1:15 PM, Peter Maydell wrote:
> On Wed, 11 Aug 2021 at 10:43, Damien Hedde <damien.hedde@greensocs.com> wrote:
>> This small series only consist in setting the user_creatable flag
>> of ibex_uart and ibex_plic devices. These two devices are already
>> using properties to configure themselves so nothing else is required.
>>
>> Note that this change alone will not allow creation of these devices
>> using -device cli option or device_add qmp command as they are sysbus
>> devices.
>>
>> We do that because we are currently working on adding the possibily
>> to configure/build a machine from qmp commands (see this rfc:
>> https://lists.gnu.org/archive/html/qemu-devel/2021-05/msg03706.html).
>> We are using these simple devices in order to test our additions.
>>
>> We prefer to send these 2 patches on a separate series as they are not
>> really related to the main topic. We will send a following series
>> for the additions.
> 
> No, these patches should go in with your other series that
> requires them, please. As standalone patches they are definitely
> wrong, because (as you note) you cannot usefully user-create a
> sysbus device like these from the command line.
> 
> Even there I'm not convinced that just marking the devices
> user-creatable is the right thing -- if we support creating
> a complete machine from QMP commands we probably want to think
> about whether that means we need to have separate categories
> of "only creatable from C code", "only creatable as part of
> QMP machine creation", "creatable on commandline but only
> for cold-plug", and "hotpluggable".
> 
> -- PMM
> 

I understand, we will put them in the main series where
we will discuss all of this.

Thanks,
--
Damien