On Thu, 06/29 13:51, Paolo Bonzini wrote: > > > On 29/06/2017 10:04, Fam Zheng wrote: > > +#define DEFINE_PROP_LINK(_name, _state, _field, _type, _check, _flags) {\ > > + .name = (_name), \ > > + .info = &(qdev_prop_link), \ > > + .offset = offsetof(_state, _field) \ > > + + type_check(Object *, typeof_field(_state, _field)), \ > > + .link.check = _check, \ > > + .link.flags = _flags, \ > > + .link_type = _type, \ > > + } > > + > > Still unsure about _check; qdev_prop_allow_set_link_before_realize is > mimicking the same behavior of any other qdev property, so it should be > always okay for DEFINE_PROP_LINK.
OK, let's drop Property.link and use constant check and flags. A DEFINE_PROP_LINK_FULL can always be added later. Fam