diff options
-rw-r--r-- | hw/core/qdev.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 2eacac0787..ff81f675da 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -988,7 +988,12 @@ void qdev_alias_all_properties(DeviceState *target, Object *source) static int qdev_add_hotpluggable_device(Object *obj, void *opaque) { GSList **list = opaque; - DeviceState *dev = DEVICE(obj); + DeviceState *dev = (DeviceState *)object_dynamic_cast(OBJECT(obj), + TYPE_DEVICE); + + if (dev == NULL) { + return 0; + } if (dev->realized && object_property_get_bool(obj, "hotpluggable", NULL)) { *list = g_slist_append(*list, dev); |