Re: [Qemu-devel] [PATCH v4 2/4] qobject: use a QObjectBase_ struct

2018-04-16 Thread Marc-André Lureau
On Mon, Apr 16, 2018 at 10:31 AM, Markus Armbruster wrote: > Markus Armbruster writes: > >> 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 wit

Re: [Qemu-devel] [PATCH v4 2/4] qobject: use a QObjectBase_ struct

2018-04-16 Thread Marc-André Lureau
Hi On Mon, Apr 16, 2018 at 10:12 AM, Markus Armbruster wrote: > 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 >>

Re: [Qemu-devel] [PATCH v4 2/4] qobject: use a QObjectBase_ struct

2018-04-16 Thread Markus Armbruster
Markus Armbruster writes: > 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 v4 2/4] qobject: use a QObjectBase_ struct

2018-04-16 Thread Markus Armbruster
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() macro ensures that the object to >

[Qemu-devel] [PATCH v4 2/4] qobject: use a QObjectBase_ struct

2018-04-13 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