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

2018-04-27 Thread Eric Blake
On 04/27/2018 03:24 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 writing a generic QOBJECT() >> macro that will work with any QObject type, including QObject >> itself

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

2018-04-27 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 writing a generic QOBJECT() > macro that will work with any QObject type, including QObject > itself. The container_of() macro ensures that the object to cas

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

2018-04-19 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 writing 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, giv