mbox series

[v3,0/3] Dynamic sysbus device check error report

Message ID 20211029142258.484907-1-damien.hedde@greensocs.com
Headers show
Series Dynamic sysbus device check error report | expand

Message

Damien Hedde Oct. 29, 2021, 2:22 p.m. UTC
Hi,

Dynamic sysbus devices are allowed by a per-machine basis.
Right now, the allowance check is done during an machine_init_done
notifier, well after such devices are created.

This series move the check at the right place (during the handling
of a QMP device_add command or -device CLI option) so that we can
report the error right away.

This was initially part of my RFC (hence the v3) about allowing to
create devices during the machine initialized phase (link is below).
But it seems to me these patches make sense already as a standalone
cleanup.

Only patch 1 miss a review.

Thanks,
Damien

v3:
 + standalone series
 + minor tweaks

v2 was part of:
https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg05683.html

Damien Hedde (3):
  machine: add device_type_is_dynamic_sysbus function
  qdev-monitor: Check sysbus device type before creating it
  machine: remove the done notifier for dynamic sysbus device type check

 include/hw/boards.h    | 16 +++++++++++++++-
 hw/core/machine.c      | 40 ++++++++++------------------------------
 softmmu/qdev-monitor.c | 11 +++++++++++
 3 files changed, 36 insertions(+), 31 deletions(-)

Comments

Philippe Mathieu-Daudé Oct. 29, 2021, 8 p.m. UTC | #1
On 10/29/21 16:22, Damien Hedde wrote:
> Hi,
> 
> Dynamic sysbus devices are allowed by a per-machine basis.
> Right now, the allowance check is done during an machine_init_done
> notifier, well after such devices are created.
> 
> This series move the check at the right place (during the handling
> of a QMP device_add command or -device CLI option) so that we can
> report the error right away.
> 
> This was initially part of my RFC (hence the v3) about allowing to
> create devices during the machine initialized phase (link is below).
> But it seems to me these patches make sense already as a standalone
> cleanup.

LGTM but I'd like an Ack from Eduardo or Marcel.
Eduardo Habkost Nov. 1, 2021, 3:18 p.m. UTC | #2
On Fri, Oct 29, 2021 at 04:22:55PM +0200, Damien Hedde wrote:
> Hi,
> 
> Dynamic sysbus devices are allowed by a per-machine basis.
> Right now, the allowance check is done during an machine_init_done
> notifier, well after such devices are created.
> 
> This series move the check at the right place (during the handling
> of a QMP device_add command or -device CLI option) so that we can
> report the error right away.
> 
> This was initially part of my RFC (hence the v3) about allowing to
> create devices during the machine initialized phase (link is below).
> But it seems to me these patches make sense already as a standalone
> cleanup.
> 
> Only patch 1 miss a review.
> 
> Thanks,
> Damien
> 
> v3:
>  + standalone series
>  + minor tweaks
> 
> v2 was part of:
> https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg05683.html

Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Philippe Mathieu-Daudé Nov. 1, 2021, 6:30 p.m. UTC | #3
On 10/29/21 16:22, Damien Hedde wrote:
> Hi,
> 
> Dynamic sysbus devices are allowed by a per-machine basis.
> Right now, the allowance check is done during an machine_init_done
> notifier, well after such devices are created.
> 
> This series move the check at the right place (during the handling
> of a QMP device_add command or -device CLI option) so that we can
> report the error right away.

> Damien Hedde (3):
>   machine: add device_type_is_dynamic_sysbus function
>   qdev-monitor: Check sysbus device type before creating it
>   machine: remove the done notifier for dynamic sysbus device type check

Thanks, series queued to machine-next.