On Tue, Sep 22, 2020 at 09:47:57AM +0800, Li Qiang wrote: > Eduardo Habkost <ehabk...@redhat.com> 于2020年9月22日周二 上午6:11写道: > > > > Class properties make QOM introspection simpler and easier, as it > > doesn't require an object to be instantiated. This series > > converts a few existing object_property_add*() calls to register > > class properties instead. > > > > Hello Eduardo, > > IIUC, most of the properties can be dev-spec or class-spec. > Do we have any principle or rule to specify the property to be dev or class? > > Maybe if the property which is always the same between instances can > be a class-property?
If you are talking about having the same value, this is not the use case for class properties. Registering a class property just means all instances of the object will have that property (but each instance can have the property set to a different value), and makes this information available for introspection before instantiating the object. -- Eduardo