Skip to content

Commit

Permalink
hw/arm/digic: Mark device with user_creatable = false
Browse files Browse the repository at this point in the history
QEMU currently shows some unexpected behavior when the user trys to
do a "device_add digic" on an unrelated ARM machine like integratorcp
in "-nographic" mode (the device_add command does not immediately
return to the monitor prompt), and trying to "device_del" the device
later results in a "qemu/qdev-monitor.c:872:qdev_unplug: assertion
failed: (hotplug_ctrl)" error condition.
Looking at the realize function of the device, it uses serial_hds
directly and this means that the device can not be added a second
time, so let's simply mark it with "user_creatable = false" now.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
huth authored and pm215 committed Sep 4, 2017
1 parent 469f3da commit f58f255
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hw/arm/digic.c
Expand Up @@ -101,6 +101,8 @@ static void digic_class_init(ObjectClass *oc, void *data)
DeviceClass *dc = DEVICE_CLASS(oc);

dc->realize = digic_realize;
/* Reason: Uses serial_hds in the realize function --> not usable twice */
dc->user_creatable = false;
}

static const TypeInfo digic_type_info = {
Expand Down

0 comments on commit f58f255

Please sign in to comment.