Re: [Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-23 Thread Markus Armbruster
Peter Maydell writes: > On Thu, 23 May 2019 at 13:09, Markus Armbruster wrote: >> Registering qbus_reset_all_fn() in main() is kind of ugly, but it works. >> There's a comment pointing out it's ugly. Right now it's a TODO >> comment, which maybe expresses more hope for cleanup than there really

Re: [Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-23 Thread Damien Hedde
On 5/23/19 2:12 PM, Peter Maydell wrote: > ...so after this long thread, are we at a conclusion? > I think my view is that the patch-as-sent needs to be > revised to also fix bus_unparent() but is otherwise OK. > I think so too. Damien

Re: [Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-23 Thread Peter Maydell
On Thu, 23 May 2019 at 13:09, Markus Armbruster wrote: > Registering qbus_reset_all_fn() in main() is kind of ugly, but it works. > There's a comment pointing out it's ugly. Right now it's a TODO > comment, which maybe expresses more hope for cleanup than there really > is. I'd leave it alone an

Re: [Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-23 Thread Markus Armbruster
Peter Maydell writes: > On Thu, 23 May 2019 at 07:39, Markus Armbruster wrote: >> >> Peter Maydell writes: >> > It's a well-defined order, but it doesn't actually help in a >> > lot of cases, because often the thing you care about ordering >> > on is not a device or is not in the same tree as t

Re: [Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-23 Thread Peter Maydell
On Thu, 23 May 2019 at 07:39, Markus Armbruster wrote: > > Peter Maydell writes: > > It's a well-defined order, but it doesn't actually help in a > > lot of cases, because often the thing you care about ordering > > on is not a device or is not in the same tree as the thing > > it depends on. > >

Re: [Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-22 Thread Markus Armbruster
Peter Maydell writes: > On Tue, 21 May 2019 at 15:34, Markus Armbruster wrote: >> >> Damien Hedde writes: >> >> > On 5/16/19 11:19 AM, Peter Maydell wrote: >> >> On Thu, 16 May 2019 at 06:37, Markus Armbruster wrote: >> >>> >> >>> A registry of callbacks to run on certain events is a fine tech

Re: [Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-21 Thread Peter Maydell
On Tue, 21 May 2019 at 15:34, Markus Armbruster wrote: > > Damien Hedde writes: > > > On 5/16/19 11:19 AM, Peter Maydell wrote: > >> On Thu, 16 May 2019 at 06:37, Markus Armbruster wrote: > >>> > >>> A registry of callbacks to run on certain events is a fine technique. > >>> Relying on registrat

Re: [Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-21 Thread Markus Armbruster
Damien Hedde writes: > On 5/16/19 11:19 AM, Peter Maydell wrote: >> On Thu, 16 May 2019 at 06:37, Markus Armbruster wrote: >>> >>> Peter Maydell writes: >>> In commit 80376c3fc2c38fdd453 in 2010 we added a workaround for some qbus buses not being connected to qdev devices -- if the >>

Re: [Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-20 Thread Damien Hedde
On 5/16/19 11:19 AM, Peter Maydell wrote: > On Thu, 16 May 2019 at 06:37, Markus Armbruster wrote: >> >> Peter Maydell writes: >> >>> In commit 80376c3fc2c38fdd453 in 2010 we added a workaround for >>> some qbus buses not being connected to qdev devices -- if the >>> bus has no parent object t

Re: [Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-16 Thread Peter Maydell
On Thu, 16 May 2019 at 06:37, Markus Armbruster wrote: > > Peter Maydell writes: > > > In commit 80376c3fc2c38fdd453 in 2010 we added a workaround for > > some qbus buses not being connected to qdev devices -- if the > > bus has no parent object then we register a reset function which > > resets

Re: [Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-15 Thread Markus Armbruster
Peter Maydell writes: > In commit 80376c3fc2c38fdd453 in 2010 we added a workaround for > some qbus buses not being connected to qdev devices -- if the > bus has no parent object then we register a reset function which > resets the bus on system reset. > > Nearly a decade later, we have now no bu

[Qemu-devel] [RFC] hw/core/bus.c: Only the main system bus can have no parent

2019-05-14 Thread Peter Maydell
In commit 80376c3fc2c38fdd453 in 2010 we added a workaround for some qbus buses not being connected to qdev devices -- if the bus has no parent object then we register a reset function which resets the bus on system reset. Nearly a decade later, we have now no buses in the tree which are created w