Re: [Qemu-devel] [PATCH v3 2/4] qobject: introduce QObjectCommon

2018-03-29 Thread Eric Blake
On 03/29/2018 10:48 AM, Marc-André Lureau wrote: By moving the common fields to a QObjectCommon, QObject can be a type which also has a 'base' QObjectCommon field. This allows to write a generic QOBJECT() macro that will work with any QObject type, including QObject itself. The container_of() mac

[Qemu-devel] [PATCH v3 2/4] qobject: introduce QObjectCommon

2018-03-29 Thread Marc-André Lureau
By moving the common fields to a QObjectCommon, QObject can be a type which also has a 'base' QObjectCommon field. This allows to write a generic QOBJECT() macro that will work with any QObject type, including QObject itself. The container_of() macro ensures that the object to cast has a QObjectCom