hw/arm/aspeed_soc: Mark devices as user_creatable = false
PATCH 1/1 hw/arm/aspeed_soc: Mark devices as user_creatable = false
QEMU currently aborts if the user is accidentially trying to do something like this:
$ aarch64-softmmu/qemu-system-aarch64 -S -M integratorcp -nographic QEMU 2.9.93 monitor - type 'help' for more information (qemu) device_add ast2400 Unexpected error in error_set_from_qdev_prop_error() at hw/core/qdev-properties.c:1032: Aborted (core dumped)
The ast2400 SoC devices are clearly not creatable by the user since they are using the serial_hds and nd_table arrays directly in their realize function, so mark them with user_creatable = false.
--- hw/arm/aspeed_soc.c | 2 ++ 1 file changed, 2 insertions(+)
hw/arm/aspeed_soc.c +2 -0
@@ -338,6 +338,8 @@ static void aspeed_soc_class_init(ObjectClass *oc, void *data) sc->info = (AspeedSoCInfo *) data; dc->realize = aspeed_soc_realize; +/* Reason: Uses serial_hds and nd_table in realize() directly */ + dc->user_creatable = false; }static const TypeInfo aspeed_soc_type_info = {
Signature · 1 line
1.8.3.1
Quoted 10 lines · Thomas Huth
QEMU currently aborts if the user is accidentially trying to do something like this:
$ aarch64-softmmu/qemu-system-aarch64 -S -M integratorcp -nographic QEMU 2.9.93 monitor - type 'help' for more information (qemu) device_add ast2400 Unexpected error in error_set_from_qdev_prop_error() at hw/core/qdev-properties.c:1032: Aborted (core dumped)
Quoted 3 lines
The ast2400 SoC devices are clearly not creatable by the user since they are using the
serial_hdsandnd_tablearrays directly in their realize function, so mark them withuser_creatable= false.
yes. I suppose we don't need to instantiate such an object without the machine. And even for unit tests, we would rather use the individual controller models.
Quoted 1 line
Signed-off-by Thomas Huth <[email protected]>
Thanks,
C.
Quoted 18 lines
--- hw/arm/aspeed_soc.c | 2 ++ 1 file changed, 2 insertions(+)hw/arm/aspeed_soc.c +2
-0@@ -338,6 +338,8 @@ static void aspeed_soc_class_init(ObjectClass *oc, void *data) sc->info = (AspeedSoCInfo *) data; dc->realize = aspeed_soc_realize; +/* Reason: Uses serial_hds and nd_table in realize() directly */ + dc->user_creatable = false; }static const TypeInfo aspeed_soc_type_info = {
Peter Maydell
AppliedQuoted 33 lines · Thomas Huth
QEMU currently aborts if the user is accidentially trying to do something like this:
$ aarch64-softmmu/qemu-system-aarch64 -S -M integratorcp -nographic QEMU 2.9.93 monitor - type 'help' for more information (qemu) device_add ast2400 Unexpected error in error_set_from_qdev_prop_error() at hw/core/qdev-properties.c:1032: Aborted (core dumped)The ast2400 SoC devices are clearly not creatable by the user since they are using the
serial_hdsandnd_tablearrays directly in their realize function, so mark them withuser_creatable= false.Signed-off-by Thomas Huth <[email protected]>--- hw/arm/aspeed_soc.c | 2 ++ 1 file changed, 2 insertions(+)hw/arm/aspeed_soc.c +2
-1@@ -338,6 +338,8 @@ static void aspeed_soc_class_init(ObjectClass *oc, void *data) sc->info = (AspeedSoCInfo *) data; dc->realize = aspeed_soc_realize; +/* Reason: Uses serial_hds and nd_table in realize() directly */ + dc->user_creatable = false; }static const TypeInfo aspeed_soc_type_info = { --
Quoted 1 line
1.8.3.1
Applied to target-arm.next for 2.11, thanks.
-- PMM