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