Received: from [140.186.70.92] (port=51253 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OoHYk-0002vq-N5 for qemu-devel@nongnu.org; Wed, 25 Aug 2010 11:06:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OoHYf-0008N0-Fa for qemu-devel@nongnu.org; Wed, 25 Aug 2010 11:06:38 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:44308) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OoHYf-0008MT-72 for qemu-devel@nongnu.org; Wed, 25 Aug 2010 11:06:33 -0400 Date: Thu, 26 Aug 2010 00:17:13 +0900 From: Isaku Yamahata Subject: Re: [Qemu-devel] [PATCH] qdev: Reset hotplugged devices Message-ID: <20100825151713.GB16489@valinux.co.jp> References: <20100803161914.15514.59304.stgit@localhost6.localdomain6> <1282308092.3860.0.camel@x201> <4C6EA5C9.8080700@codemonkey.ws> <20100825030752.GA14605@valinux.co.jp> <4C7512BF.9000805@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C7512BF.9000805@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 Wed, Aug 25, 2010 at 07:55:27AM -0500, Anthony Liguori wrote: >> 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. >> > > I disagree. Reset should be equivalent to power off + init and it's not > something that can be selectively propagated. > > There are different types of bus level resets and it may make sense to > model that in the PCI layer but the qdev reset is a power cycle > semantically. > > I think using a walker pattern is a stronger design than having each > reset function do it's own transversal because the later has the > potential to introduce bugs. Warm reset is different from cold reset, so reset isn't equivalent to a power cycle. Typically registers which report errors must retain the contents across warm reset, but doesn't across a power cycle. I can see the reset call back is called when both power on and warm reset, but I don't see why qdev_reset() is a power cycle semantically. Although your current patch might work for me at the moment, the claim that qdev_reset() == a power cycle worries me. How about adding a argument to distinguish reset type? Something like QEMU_RESET_COLD, QEMU_RESET_WARM. -- yamahata