From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbqiT-0006hA-VX for qemu-devel@nongnu.org; Tue, 05 Jun 2012 06:10:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbqiN-0007ey-K1 for qemu-devel@nongnu.org; Tue, 05 Jun 2012 06:10:21 -0400 Received: from e7.ny.us.ibm.com ([32.97.182.137]:40662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbqiN-0007eM-GR for qemu-devel@nongnu.org; Tue, 05 Jun 2012 06:10:15 -0400 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Jun 2012 06:10:10 -0400 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 45EF538C801C for ; Tue, 5 Jun 2012 06:10:08 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q55AA7dO20971600 for ; Tue, 5 Jun 2012 06:10:07 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q55AA7xe024668 for ; Tue, 5 Jun 2012 07:10:07 -0300 Message-ID: <4FCDDAFA.5020104@us.ibm.com> Date: Tue, 05 Jun 2012 18:10:02 +0800 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: Peter Maydell Cc: yamahata@valinux.co.jp, quintela@redhat.com, Michael Roth , qemu-devel@nongnu.org, owasserm@redhat.com, pbonzini@redhat.com, akong@redhat.com, afaerber@suse.de On 06/05/2012 06:00 PM, Peter Maydell wrote: > On 5 June 2012 02:00, Michael Roth wrote: >> +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. (This could be mitigated with some > kind of naming convention so it's easy to spot bogus includes in > code review, like "mydevice.int.h" or something.) Another way to solve this problem is having more directory hierarchy and using public includes (include/qemu) verses private includes (devices/pci/virtio/virtio_ring.h). > > Whatever format we use, we should make sure it has the potential > to be extensible with markup for "this field is a qom property", I've already added a '_property' marker which can be used to generate QOM static property listings. Regards, Anthony Liguori > "this class foo is a subclass of class bar", "this class has > methods x,y,z" etc, so we can improve our autogeneration later to > cut out repetitive boilerplate like property array definitions, > initializers and wrapper functions. > > (I wouldn't object to a not-actually-C syntax definition which > produced a header with the C struct as one of its outputs.) > > -- PMM >