[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 1/8] include/hw/boards.h: Add a member in Mac
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-devel] [PATCH v3 1/8] include/hw/boards.h: Add a member in MachineState to store irq array |
Date: |
Tue, 16 Jun 2015 20:16:56 -0700 |
On Tue, Jun 16, 2015 at 7:59 PM, Shannon Zhao <address@hidden> wrote:
> From: Shannon Zhao <address@hidden>
>
> Here we add a member in MachineState to store the irq array returned
> from qemu_allocate_irqs. Then these irq arrays will be free before QEMU
> exit and it will be used to fix the memory leak due to misuse
> qemu_allocate_irqs.
>
This is based on an assumption that IRQ are a global concept. This (as
well as the one global address space) is something we really should
get away from. A better appoach would be to child the IRQs to the
Machine object (note that IRQs are QOM objects) for those machines
where this assumption makes sense. Then we don't have to pollute
common structs.
Regards,
Peter
> Signed-off-by: Shannon Zhao <address@hidden>
> Signed-off-by: Shannon Zhao <address@hidden>
> ---
> include/hw/boards.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index 6379901..0dea769 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -148,6 +148,7 @@ struct MachineState {
> char *initrd_filename;
> const char *cpu_model;
> AccelState *accelerator;
> + qemu_irq *irqs;
> };
>
> #endif
> --
> 2.0.4
>
>
>
- [Qemu-devel] [PATCH v3 0/8] Add a member in MachineState to store irq array, Shannon Zhao, 2015/06/16
- [Qemu-devel] [PATCH v3 4/8] hw/m68k/an5206.c: Store irq array in MachineState to fix memory leak, Shannon Zhao, 2015/06/16
- [Qemu-devel] [PATCH v3 3/8] hw/sparc/leon3.c: Store irq array in MachineState to fix memory leak, Shannon Zhao, 2015/06/16
- [Qemu-devel] [PATCH v3 5/8] hw/sh4/r2d.c: Store irq array in MachineState to fix memory leak, Shannon Zhao, 2015/06/16
- [Qemu-devel] [PATCH v3 6/8] hw/arm/palm.c: Store irq array in MachineState to fix memory leak, Shannon Zhao, 2015/06/16
- [Qemu-devel] [PATCH v3 8/8] hw/arm/tosa.c: Store irq array in MachineState to fix memory leak, Shannon Zhao, 2015/06/16
- [Qemu-devel] [PATCH v3 7/8] hw/arm/spitz.c: Store irq array in MachineState to fix memory leak, Shannon Zhao, 2015/06/16
- [Qemu-devel] [PATCH v3 1/8] include/hw/boards.h: Add a member in MachineState to store irq array, Shannon Zhao, 2015/06/16
- Re: [Qemu-devel] [PATCH v3 1/8] include/hw/boards.h: Add a member in MachineState to store irq array,
Peter Crosthwaite <=
- [Qemu-devel] [PATCH v3 2/8] hw/ppc/ppc440_bamboo.c: Store irq array in MachineState to fix memory leak, Shannon Zhao, 2015/06/16
- Re: [Qemu-devel] [PATCH v3 0/8] Add a member in MachineState to store irq array, Michael Tokarev, 2015/06/17