object_unref(OBJECT(dev));
}
+static int qdev_assert_realized_properly(Object *obj, void *opaque)
+{
+ DeviceState *dev = DEVICE(object_dynamic_cast(obj, TYPE_DEVICE));
+ DeviceClass *dc;
+
+ if (dev) {
+ dc = DEVICE_GET_CLASS(dev);
+ assert(dev->realized);
+ assert(dev->parent_bus || !dc->bus_type);
+ }
+ return 0;
+}
+
void qdev_machine_creation_done(void)
{
/*
* only create hotpluggable devices
*/
qdev_hotplug = true;
+
+ object_child_foreach_recursive(object_get_root(),
+ qdev_assert_realized_properly, NULL);
}
bool qdev_machine_modified(void)