From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MZ3d0-00059V-05 for qemu-devel@nongnu.org; Thu, 06 Aug 2009 10:07:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MZ3cv-00058r-Bz for qemu-devel@nongnu.org; Thu, 06 Aug 2009 10:07:33 -0400 Received: from [199.232.76.173] (port=58891 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZ3cv-00058n-7T for qemu-devel@nongnu.org; Thu, 06 Aug 2009 10:07:29 -0400 Received: from mx2.redhat.com ([66.187.237.31]:35562) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MZ3cu-00062h-M4 for qemu-devel@nongnu.org; Thu, 06 Aug 2009 10:07:28 -0400 Date: Thu, 6 Aug 2009 11:07:13 -0300 From: Luiz Capitulino Message-ID: <20090806110713.17a849de@doriath> In-Reply-To: <4A7AE288.1020905@redhat.com> References: <1249566736-5020-1-git-send-email-lcapitulino@redhat.com> <1249566736-5020-2-git-send-email-lcapitulino@redhat.com> <4A7AE288.1020905@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 1/3] Introduce qobject header file List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: aliguori@us.ibm.com, filip.navara@gmail.com, qemu-devel@nongnu.org On Thu, 06 Aug 2009 17:02:48 +0300 Avi Kivity wrote: > On 08/06/2009 04:52 PM, Luiz Capitulino wrote: > > This file contains basic definitions for the QEMU Object Model, > > all object implementions must include this file and add its > > type code in qtype_t enum. > > > > > > + > > +typedef enum { > > + QTYPE_NONE, > > +} qtype_t; > > + > > +struct QObject; > > + > > +typedef struct QType { > > + qtype_t code; > > > > Is this really needed? You can check if an object is a particular type > by checking its ->type agains whatever you're interested in. Of course > you should refrain from doing so unless there's no choice. Each QType definition is private to each type's module, I would have to make them public then.