From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mns5D-0004ug-Rq for qemu-devel@nongnu.org; Wed, 16 Sep 2009 06:49:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mns59-0004tp-5l for qemu-devel@nongnu.org; Wed, 16 Sep 2009 06:49:55 -0400 Received: from [199.232.76.173] (port=48298 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mns58-0004tm-Td for qemu-devel@nongnu.org; Wed, 16 Sep 2009 06:49:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40564) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mns58-00008M-CH for qemu-devel@nongnu.org; Wed, 16 Sep 2009 06:49:50 -0400 Date: Wed, 16 Sep 2009 13:47:49 +0300 From: "Michael S. Tsirkin" Message-ID: <20090916104749.GA4473@redhat.com> References: <20090915143319.GB24708@redhat.com> <20090916093445.GA1404@redhat.com> <4AB0B875.2060507@redhat.com> <20090916100613.GA4298@redhat.com> <4AB0BC64.3050800@redhat.com> <20090916103051.GA4361@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090916103051.GA4361@redhat.com> Subject: [Qemu-devel] Re: [PATCH 1/2] qemu/qdev: type safety in reset handler List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Carsten Otte , markmc@redhat.com, Paul Brook , qemu-devel@nongnu.org, Christian Borntraeger , Avi Kivity , Juan Quintela On Wed, Sep 16, 2009 at 01:30:51PM +0300, Michael S. Tsirkin wrote: > On Wed, Sep 16, 2009 at 12:22:28PM +0200, Gerd Hoffmann wrote: > > On 09/16/09 12:06, Michael S. Tsirkin wrote: > >>> How about going one step further? Register *one* qdev_reset instance > >>> which then walks the qdev tree and calls ->reset() for every device? > >> > >> Will be much more code. Why not reuse the existing queue? > > > > I think we'll need such a tree walker anyway sooner or later. Thus > > you'll get bonus points for making it generic, so it could be used for a > > -- say -- late_init() callback too. > > > > Also the reset() callbacks order will be based on the position of the > > device in the tree instead of being more or less random. > > > > cheers, > > Gerd > > Better make it a separate patch, later. > For now, I'm just addressing the type safety. To clarify: I don't know enough about qdev to see how easy it is. Care to send a patch on top of mine? > -- > MST