From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57082 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OoJAG-0000zz-JU for qemu-devel@nongnu.org; Wed, 25 Aug 2010 12:49:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OoJAA-0000Wk-Ck for qemu-devel@nongnu.org; Wed, 25 Aug 2010 12:49:23 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:44586) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OoJAA-0000WL-8G for qemu-devel@nongnu.org; Wed, 25 Aug 2010 12:49:22 -0400 Received: by pwi10 with SMTP id 10so373456pwi.4 for ; Wed, 25 Aug 2010 09:49:20 -0700 (PDT) Message-ID: <4C75498F.2090006@codemonkey.ws> Date: Wed, 25 Aug 2010 11:49:19 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] qdev: Reset hotplugged devices 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> <20100825151713.GB16489@valinux.co.jp> In-Reply-To: <20100825151713.GB16489@valinux.co.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: Alex Williamson , glommer@redhat.com, Markus Armbruster , qemu-devel@nongnu.org On 08/25/2010 10:17 AM, Isaku Yamahata wrote: > 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. But qdev reset is not warm reset. It's cold reset. IOW, it's called when the device is first powered up. > 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. > Before approaching this, I think we ought to better understand exactly what type of reset semantics we would need to support in the future. I think that starts by understanding exactly what's guaranteed and understanding what the use cases are for it. Regards, Anthony Liguori