On 6 September 2018 at 13:02, Thomas Huth <th...@redhat.com> wrote: > I somehow fail to see that something outside of lsi53c895a.c should > really need to access the internals of LSIState. If there is something > that needs to be configured from the outside, it should be done via QOM > properties instead, shouldn't it? So I think I'd rather prefer if you > could do it the other way round and change the lsi*_create() functions > to return a pointer to PCIDevice instead, if possible.
Nothing typically does, but the "modern" style of having QOM objects which use other QOM objects do so by embedding the child object's struct into the struct of the parent requires that the struct definition is available. The only thing of it that is used is (effectively) its size and alignment requirements. (I had an RFC patch some years back that would allow you to mark up the fields of the struct as private, so the struct could be put in the header but the compiler would complain if you tried to actually access any of its fields: http://lists.gnu.org/archive/html/qemu-devel/2014-05/msg01846.html ) thanks -- PMM