* [Qemu-devel] [PATCH] hw/arm/aspeed_soc: Mark devices as user_creatable = false
@ 2017-08-22 12:47 Thomas Huth
2017-08-22 14:24 ` Cédric Le Goater
2017-08-22 17:31 ` Peter Maydell
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Huth @ 2017-08-22 12:47 UTC (permalink / raw)
To: Peter Maydell, qemu-arm
Cc: Cédric Le Goater, Andrew Jeffery, Jeremy Kerr, qemu-devel
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.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/arm/aspeed_soc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
index 5529024..7f1be04 100644
--- a/hw/arm/aspeed_soc.c
+++ b/hw/arm/aspeed_soc.c
@@ -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 = {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/arm/aspeed_soc: Mark devices as user_creatable = false
2017-08-22 12:47 [Qemu-devel] [PATCH] hw/arm/aspeed_soc: Mark devices as user_creatable = false Thomas Huth
@ 2017-08-22 14:24 ` Cédric Le Goater
2017-08-22 17:31 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Cédric Le Goater @ 2017-08-22 14:24 UTC (permalink / raw)
To: Thomas Huth, Peter Maydell, qemu-arm
Cc: Andrew Jeffery, Jeremy Kerr, qemu-devel
On 08/22/2017 02:47 PM, Thomas Huth wrote:
> 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.
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.
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Thanks,
C.
> ---
> hw/arm/aspeed_soc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
> index 5529024..7f1be04 100644
> --- a/hw/arm/aspeed_soc.c
> +++ b/hw/arm/aspeed_soc.c
> @@ -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 = {
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/arm/aspeed_soc: Mark devices as user_creatable = false
2017-08-22 12:47 [Qemu-devel] [PATCH] hw/arm/aspeed_soc: Mark devices as user_creatable = false Thomas Huth
2017-08-22 14:24 ` Cédric Le Goater
@ 2017-08-22 17:31 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2017-08-22 17:31 UTC (permalink / raw)
To: Thomas Huth
Cc: qemu-arm, Cédric Le Goater, Andrew Jeffery, Jeremy Kerr,
QEMU Developers
On 22 August 2017 at 13:47, Thomas Huth <thuth@redhat.com> wrote:
> 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.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> hw/arm/aspeed_soc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
> index 5529024..7f1be04 100644
> --- a/hw/arm/aspeed_soc.c
> +++ b/hw/arm/aspeed_soc.c
> @@ -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 = {
> --
> 1.8.3.1
Applied to target-arm.next for 2.11, thanks.
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-22 17:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-22 12:47 [Qemu-devel] [PATCH] hw/arm/aspeed_soc: Mark devices as user_creatable = false Thomas Huth
2017-08-22 14:24 ` Cédric Le Goater
2017-08-22 17:31 ` Peter Maydell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.