From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53304 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oo6Ay-0000yW-Dr for qemu-devel@nongnu.org; Tue, 24 Aug 2010 22:57:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oo6Ax-00058R-DJ for qemu-devel@nongnu.org; Tue, 24 Aug 2010 22:57:20 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:50092) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oo6Ax-00058B-2S for qemu-devel@nongnu.org; Tue, 24 Aug 2010 22:57:19 -0400 Date: Wed, 25 Aug 2010 12:07:52 +0900 From: Isaku Yamahata Subject: Re: [Qemu-devel] [PATCH] qdev: Reset hotplugged devices Message-ID: <20100825030752.GA14605@valinux.co.jp> References: <20100803161914.15514.59304.stgit@localhost6.localdomain6> <1282308092.3860.0.camel@x201> <4C6EA5C9.8080700@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C6EA5C9.8080700@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Alex Williamson , glommer@redhat.com, Markus Armbruster , qemu-devel@nongnu.org On Fri, Aug 20, 2010 at 10:56:57AM -0500, Anthony Liguori wrote: > The real problem is how we do reset. We shouldn't register a reset > handler for every qdev device but rather register a single reset handler > that walks the device tree and calls reset on every reachable device. > > Then we can always call reset in init() and there's no need to have a > dev->hotplugged check. The qdev device tree reset handler should not be > registered until *after* we call qemu_system_reset() after creating the > device model which will ensure that we don't do a double reset. I don't see why you re-invent the patch. Please see the patches I sent out on August 5. http://lists.nongnu.org/archive/html/qemu-devel/2010-08/msg00377.html http://lists.nongnu.org/archive/html/qemu-devel/2010-08/msg00383.html Maybe we can merge the patches. As for your patch, I have some comment. - bus itself may want its own handler. At lease pci bus needs it. And propagating reset signal to children is up to the bus controller. - child devices should be reset before parent. This doesn't matter much though. -- yamahata