From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se4R6-0002UO-LS for qemu-devel@nongnu.org; Mon, 11 Jun 2012 09:13:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Se4R0-0006XW-SI for qemu-devel@nongnu.org; Mon, 11 Jun 2012 09:13:36 -0400 Received: from e34.co.us.ibm.com ([32.97.110.152]:38703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se4R0-0006Ug-Lj for qemu-devel@nongnu.org; Mon, 11 Jun 2012 09:13:30 -0400 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 Jun 2012 07:13:22 -0600 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 1C6A419D804E for ; Mon, 11 Jun 2012 13:12:27 +0000 (WET) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5BDCQj4171026 for ; Mon, 11 Jun 2012 07:12:26 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5BDDFiC012430 for ; Mon, 11 Jun 2012 07:13:15 -0600 Message-ID: <4FD5EEB5.6040409@us.ibm.com> Date: Mon, 11 Jun 2012 08:12:21 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1338858018-17189-1-git-send-email-mdroth@linux.vnet.ibm.com> <1338858018-17189-2-git-send-email-mdroth@linux.vnet.ibm.com> <4FD59AA2.3000707@suse.de> <4FD59C3F.2020306@redhat.com> In-Reply-To: <4FD59C3F.2020306@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 01/17] qidl: add QEMU IDL processor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Maydell , quintela@redhat.com, qemu-devel@nongnu.org, Michael Roth , owasserm@redhat.com, akong@redhat.com, =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , yamahata@valinux.co.jp 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 >