summary refs log tree commit diff stats
path: root/hw/arm/digic.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2017-09-04 15:21:55 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-09-04 17:13:53 +0100
commitf58f25599b72c7479e6a1ff67c7f671823aa14da (patch)
tree55d744dcda4ab44455e37f3f88d8c898f3f376b1 /hw/arm/digic.c
parent469f3da42ef4af347fa7831e1cc0bd35d17f5b83 (diff)
downloadfocaccia-qemu-f58f25599b72c7479e6a1ff67c7f671823aa14da.tar.gz
focaccia-qemu-f58f25599b72c7479e6a1ff67c7f671823aa14da.zip
hw/arm/digic: Mark device with user_creatable = false
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>
Diffstat (limited to 'hw/arm/digic.c')
-rw-r--r--hw/arm/digic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/arm/digic.c b/hw/arm/digic.c
index 94f32637f0..6184020985 100644
--- a/hw/arm/digic.c
+++ b/hw/arm/digic.c
@@ -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 = {