Il 02/07/2014 11:07, Alexander Graf ha scritto:
So the way this is handled for links is its an open coded check function added by the property adder. Check qdev_prop_allow_set_link_before_realize() for a precedent.
However, unlike Alex's case the link setter is complicated and a simple tail call won't do. It first computes the "val" argument that is passed to the check function, then calls the check function, then does the actual set.
Memory hotplug is using "val", so we cannot simply change the check function's signature in such a way that we would use a tail call.
I'll export all the simple integer get/set helpers to the world and use object_property_add directly. That way I can also hook in my release function that I need with this approach.
Good idea. But please make a new header file. Paolo