|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] [PATCH 01/17] qidl: add QEMU IDL processor |
Date: | Mon, 11 Jun 2012 08:12:21 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 |
On 06/11/2012 02:20 AM, Paolo Bonzini wrote:
Il 11/06/2012 09:13, Andreas Färber ha scritto:+The first step is to move your device struct definition to a header file. This +header file should only contain the struct definition and any preprocessor +declarations you need to define the structure. This header file will act as +the source for the QC IDL compiler.I don't think this is a fantastic idea -- the device struct should be private to the device, and having it in a standalone header file is asking for users of the device to illicitly include it and access internals that they shouldn't.But that is exactly where realize is headed. PCIBus, a9mp_priv etc. structs will need to be made public so that they can be embedded.I thought that was just a convenience choice, not a necessity. The children objects could just as well be heap-allocated.
Objects need some sort of type signature publicly. The question is whether that's a forward reference, a structure using PIMPL, or the full blown structure.
I really don't see the overwhelming need to keep structures private. Being able to directly reference public members is extremely handy.
I'd rather we focus on modeling more devices in a proper fashion such that we better understand their interactions and then make a decision about whether devices ought to be fully private or not.
Regards, Anthony Liguori
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |