|
@@ -938,7 +938,12 @@ void qdev_alias_all_properties(DeviceState *target, Object *source)
|
|
static int qdev_add_hotpluggable_device(Object *obj, void *opaque)
|
|
static int qdev_add_hotpluggable_device(Object *obj, void *opaque)
|
|
{
|
|
{
|
|
GSList **list = 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)) {
|
|
if (dev->realized && object_property_get_bool(obj, "hotpluggable", NULL)) {
|
|
*list = g_slist_append(*list, dev);
|
|
*list = g_slist_append(*list, dev);
|