Re: [Qemu-devel] [PATCH v5 2/5] qobject: use a QObjectBase_ struct

2018-04-18 Thread Markus Armbruster
In addition to Eric's comments... Marc-André Lureau writes: > By moving the base fields to a QObjectBase_, QObject can be a type > which also has a 'base' field. This allows to write a generic > QOBJECT() macro that will work with any QObject type, including > QObject itself. The container_of()

Re: [Qemu-devel] [PATCH v5 2/5] qobject: use a QObjectBase_ struct

2018-04-17 Thread Eric Blake
On 04/17/2018 08:35 AM, Marc-André Lureau wrote: > By moving the base fields to a QObjectBase_, QObject can be a type > which also has a 'base' field. This allows to write a generic either "allows us to write" or "allows writing" > QOBJECT() macro that will work with any QObject type, including >

[Qemu-devel] [PATCH v5 2/5] qobject: use a QObjectBase_ struct

2018-04-17 Thread Marc-André Lureau
By moving the base fields to a QObjectBase_, QObject can be a type which also has a 'base' 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 QObjectBase_ base field, gi