machine: add device_type_is_dynamic_sysbus function
commitb5fdf4102fa3ecc35e7b84a398ccb3e00ca08944
authorDamien Hedde <damien.hedde@greensocs.com>
Fri, 29 Oct 2021 14:22:56 +0000 (29 16:22 +0200)
committerPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 1 Nov 2021 18:44:11 +0000 (1 19:44 +0100)
treeb44087ebe5ff4c7de51029ec17e2d92990e69bbb
parent9e8e393bb795ff6c6963c47376369e90b1d40467
machine: add device_type_is_dynamic_sysbus function

Right now the allowance check for adding a sysbus device using
-device cli option (or device_add qmp command) is done well after
the device has been created. It is done during the machine init done
notifier: machine_init_notify() in hw/core/machine.c

This new function will allow us to do the check at the right time and
issue an error if it fails.

Also make device_is_dynamic_sysbus() use the new function.

Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20211029142258.484907-2-damien.hedde@greensocs.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
hw/core/machine.c
include/hw/boards.h