On Wed, 06/28 15:38, Paolo Bonzini wrote: > > > On 28/06/2017 14:48, Fam Zheng wrote: > > > > It's implemented by creating a wrapper property that basically forwards > > operations to a QOM "link-FOO" property, which handles the check > > callback and flags. The feature that is missing from QOM is the dynamic > > child pointer which is done in the added code with the usual "offset" > > approach. > > Would it be possible to add a ".create" field to PropertyInfo? Then > there's no need to introduce the wrapper.
QOM setter/getter want a LinkProperty opaque pointer, but qdev uses a Property pointer. I don't see a way to adapt that with .create(). Can you elaborate? > > Also, I think _check and _flags can be always > qdev_prop_allow_set_link_before_realize and > OBJ_PROP_LINK_UNREF_ON_RELEASE for DEFINE_PROP_LINK. A quick grep gave me some object_property_add_link() callers using different parameters, but I don't know if they should use DEFINE_PROP_LINK. Fam