Re: qdev instance_init vs realize split

2022-02-15 Thread Damien Hedde
On 2/15/22 14:35, Peter Maydell wrote: On Tue, 15 Feb 2022 at 13:21, Damien Hedde wrote: Are you saying that: if an operation like a mmio/irq definition is done in realize(), in theory, we should have the unrealize() counterpart ? I'm saying that at the moment we have two categories of devi

Re: qdev instance_init vs realize split

2022-02-15 Thread Peter Maydell
On Tue, 15 Feb 2022 at 13:21, Damien Hedde wrote: > Are you saying that: if an operation like a mmio/irq definition is done > in realize(), in theory, we should have the unrealize() counterpart ? I'm saying that at the moment we have two categories of device: * ones which are intended to be plug

Re: qdev instance_init vs realize split

2022-02-15 Thread Damien Hedde
On 2/15/22 12:32, Peter Maydell wrote: On Tue, 15 Feb 2022 at 10:32, Damien Hedde wrote: I'm wondering if there are rules or convention about what we put in the instance_init() vs realize() for simple devices ? (For complex ones we generally have no choice to put everything in realize()) For

Re: qdev instance_init vs realize split

2022-02-15 Thread Peter Maydell
On Tue, 15 Feb 2022 at 10:32, Damien Hedde wrote: > I'm wondering if there are rules or convention about what we put in the > instance_init() vs realize() for simple devices ? (For complex ones we > generally have no choice to put everything in realize()) > > For example we can declare irqs and mm

Re: qdev instance_init vs realize split

2022-02-15 Thread Philippe Mathieu-Daudé via
On 15/2/22 11:19, Damien Hedde wrote: Hi, I'm wondering if there are rules or convention about what we put in the instance_init() vs realize() for simple devices ? (For complex ones we generally have no choice to put everything in realize()) See Peter's recommendations here: https://www.mail

qdev instance_init vs realize split

2022-02-15 Thread Damien Hedde
Hi, I'm wondering if there are rules or convention about what we put in the instance_init() vs realize() for simple devices ? (For complex ones we generally have no choice to put everything in realize()) For example we can declare irqs and mmios in instance_init() or realize() if they do not