From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdpCe-0001ZV-FH for qemu-devel@nongnu.org; Thu, 22 Dec 2011 15:25:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdpCd-0000Tp-Lk for qemu-devel@nongnu.org; Thu, 22 Dec 2011 15:25:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdpCd-0000TW-FA for qemu-devel@nongnu.org; Thu, 22 Dec 2011 15:25:23 -0500 Message-ID: <4EF3922E.8000305@redhat.com> Date: Thu, 22 Dec 2011 21:25:18 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1324399916-21315-1-git-send-email-aliguori@us.ibm.com> <1324399916-21315-2-git-send-email-aliguori@us.ibm.com> <4EF1E094.6080500@redhat.com> <4EF1EEA4.40209@us.ibm.com> <20111222172531.GA24638@morn.localdomain> In-Reply-To: <20111222172531.GA24638@morn.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 01/27] qom: add the base Object class List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin O'Connor Cc: Anthony Liguori , qemu-devel@nongnu.org, Markus Armbruster On 12/22/2011 06:25 PM, Kevin O'Connor wrote: > Why not declare types with something like the following: > > TypeInfo my_device_info = { > .name = "my-device", > .parentinfo =&device_info, > .instance_size = sizeof(MyDevice), > }; > > That is, instead of looking up the TypeImpl via a string, lookup the > TypeImpl via the address of the TypeInfo. (Or possibly store a > pointer to TypeImpl in TypeInfo during registration.) This requires all modules to provide a header file just for the TypeInfo or TypeImpl. It doesn't let you use work purely through introspection. Paolo