|
@@ -1076,16 +1076,18 @@ void device_class_set_props(DeviceClass *dc, Property *props)
|
|
|
void qdev_alias_all_properties(DeviceState *target, Object *source)
|
|
|
{
|
|
|
ObjectClass *class;
|
|
|
- Property *prop;
|
|
|
+ ObjectPropertyIterator iter;
|
|
|
+ ObjectProperty *prop;
|
|
|
|
|
|
class = object_get_class(OBJECT(target));
|
|
|
- do {
|
|
|
- DeviceClass *dc = DEVICE_CLASS(class);
|
|
|
|
|
|
- for (prop = dc->props_; prop && prop->name; prop++) {
|
|
|
- object_property_add_alias(source, prop->name,
|
|
|
- OBJECT(target), prop->name);
|
|
|
+ object_class_property_iter_init(&iter, class);
|
|
|
+ while ((prop = object_property_iter_next(&iter))) {
|
|
|
+ if (object_property_find(source, prop->name)) {
|
|
|
+ continue; /* skip duplicate properties */
|
|
|
}
|
|
|
- class = object_class_get_parent(class);
|
|
|
- } while (class != object_class_by_name(TYPE_DEVICE));
|
|
|
+
|
|
|
+ object_property_add_alias(source, prop->name,
|
|
|
+ OBJECT(target), prop->name);
|
|
|
+ }
|
|
|
}
|