Re: [Qemu-devel] [PATCH] qdev_try_create(): Assert that devices we put onto the system bus are SysBusDevices

2016-03-19 Thread Paolo Bonzini
On 16/03/2016 15:25, Peter Maydell wrote: > > Looks strange, but okay, > You mean the way we use what looks like a cast macro and ignore > the result? Yeah, I thought that was a little odd-looking. Happy > to do it some other way if you have an alternative suggestion. Perhaps this: g_assert(obj

[Qemu-devel] [PATCH] qdev_try_create(): Assert that devices we put onto the system bus are SysBusDevices

2016-03-19 Thread Peter Maydell
If qdev_try_create() is passed NULL for the bus, it will automatically put the newly created device onto the default system bus. However if the device is not actually a SysBusDevice then this will result in later crashes (for instance when running the monitor "info qtree" command) because code reas

Re: [Qemu-devel] [PATCH] qdev_try_create(): Assert that devices we put onto the system bus are SysBusDevices

2016-03-19 Thread Andreas Färber
Am 16.03.2016 um 15:11 schrieb Peter Maydell: > If qdev_try_create() is passed NULL for the bus, it will automatically > put the newly created device onto the default system bus. However > if the device is not actually a SysBusDevice then this will result > in later crashes (for instance when runni

Re: [Qemu-devel] [PATCH] qdev_try_create(): Assert that devices we put onto the system bus are SysBusDevices

2016-03-18 Thread Peter Maydell
On 16 March 2016 at 14:14, Andreas Färber wrote: > Am 16.03.2016 um 15:11 schrieb Peter Maydell: >> If qdev_try_create() is passed NULL for the bus, it will automatically >> put the newly created device onto the default system bus. However >> if the device is not actually a SysBusDevice then this