On 08/04/2015 14:20, Eduardo Habkost wrote: >> > it would be better to create generic bit property and replace above code >> > with it >> > something similar to object_property_add_uint32_ptr() > object_property_add_*_ptr() adds read-only properties, and I didn't want > to make object_property_add_bit_ptr() inconsistent with the other > functions. But maybe it is better to have an inconsistent but reusable > API than making the new code non-reusable by keeping it inside > target-i386/cpu.c. I will give it a try.
add_*_ptr() is read-only because read-only properties do not require validations (at least that's the common case). So I think the inconsistent API is worse than a local one. > BTW, it is on my wishlist to remove the existing duplication in > DEFINE_PROP_*(), QAPI, and object_property_add_*(), that are supposed to > support the same data types without duplicating code, but this may take > a while. Yeah, that would be nice... Paolo