On 24 September 2012 20:08, Stefan Weil <s...@weilnetz.de> wrote: > It is used to avoid dynamic memory allocation for qemu_irq arrays > with known size or single qemu_irq variables.
This patch is going to collide with Peter Crosthwaite's patch that allows an irq array to be extended. Also, the memory allocated with qemu_allocate_irqs() can be freed with qemu_free_irqs(), but you don't seem to have provided any way for direct callers of qemu_init_irqs() to free the allocated IRQState array. It feels to me like it ought to be possible to avoid having random free-floating qemu_irq arrays at all : they should all belong to devices which have (in theory) an opportunity to free them in a deinit function. Explicit copying of qemu_irqs out of one array and into other places, in particular, suggests that maybe the code should be using qdev_get_gpio_in and qdev_connect_gpio_out instead. -- PMM