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.