From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Smlzz-0002L5-1n for qemu-devel@nongnu.org; Thu, 05 Jul 2012 09:21:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Smlzq-0000WC-Kq for qemu-devel@nongnu.org; Thu, 05 Jul 2012 09:21:34 -0400 Date: Thu, 5 Jul 2012 16:21:35 +0300 From: "Michael S. Tsirkin" Message-ID: <20120705132135.GE30572@redhat.com> References: <1341422373-13614-1-git-send-email-afaerber@suse.de> <1341422373-13614-15-git-send-email-afaerber@suse.de> <20120704211717.GC27653@redhat.com> <20120704212614.GA27711@redhat.com> <4FF4C4EC.2090404@suse.de> <4FF5642C.5070506@redhat.com> <4FF56928.1070001@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <4FF56928.1070001@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 14/14] pci: Tidy up PCI host bridges List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: jbaron@redhat.com, qemu-devel@nongnu.org, Alexander Graf , Andreas =?iso-8859-1?Q?F=E4rber?= , "\"list@suse.de\"@zmta06.collab.prod.int.phx2.redhat.com:New World" , anthony@codemonkey.ws, Paolo Bonzini , open@suse.de On Thu, Jul 05, 2012 at 12:15:04PM +0200, Andreas F=E4rber wrote: > Am 05.07.2012 11:53, schrieb Paolo Bonzini: > > Il 05/07/2012 00:34, Andreas F=E4rber ha scritto: > >>>> Just to clarify: replacing upcasts which are always safe > >>>> with downcasts which can fail is what I consider especially ugly. > >> As per Anthony the parent field in the QOM instance structs is not > >> supposed to be touched (cf. object.h). We mark it /*< private >*/ so > >> that it doesn't even show up in gtk-doc documentation. If it is unus= ed, > >> its name becomes irrelevant and could even be "reserved" if we so > >> wanted. Renaming it to whatever proves that all old references are g= one. > >=20 > > I disagree with removing static checks whenever possible. > >=20 > >> Background is that qdev and QOM work differently with regards to > >> inheritance: as mentioned in the preceding patch, for qdev the paren= t > >> was (had to be) identified by name and could be anywhere in the stru= ct; > >=20 > > Not entirely true, being at the beginning of the struct is already > > enforced by using DO_UPCAST (which is admittedly a strange name for a > > downcast macro) instead of container_of. >=20 > If you look at the patchset you will find that it was not properly enfo= rced! >=20 > Andreas Yes DO_UPCAST is IMO evil and should go - everyone can eiter use dynamic QOM types with lookup by name; or stop passing nonsafe void * pointers around and use container_of consistently. > --=20 > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrn= berg >=20