All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
To: Shannon Zhao <zhaoshenglong@huawei.com>
Cc: qemu-trivial <qemu-trivial@nongnu.org>,
	Michael Tokarev <mjt@tls.msk.ru>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Shannon Zhao <shannon.zhao@linaro.org>
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	[thread overview]
Message-ID: <CAEgOgz7K6k=ZVCfaMVKr1PtBKLW4WidU59wk61YOsDiykGyi8w@mail.gmail.com> (raw)
In-Reply-To: <1434510002-6976-2-git-send-email-zhaoshenglong@huawei.com>

On Tue, Jun 16, 2015 at 7:59 PM, Shannon Zhao <zhaoshenglong@huawei.com> wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
>
> 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 <zhaoshenglong@huawei.com>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> ---
>  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
>
>
>

  reply	other threads:[~2015-06-17  3:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17  2:59 [Qemu-devel] [PATCH v3 0/8] Add a member in MachineState to store irq array Shannon Zhao
2015-06-17  2:59 ` [Qemu-devel] [PATCH v3 1/8] include/hw/boards.h: " Shannon Zhao
2015-06-17  3:16   ` Peter Crosthwaite [this message]
2015-06-17  2:59 ` [Qemu-devel] [PATCH v3 2/8] hw/ppc/ppc440_bamboo.c: Store irq array in MachineState to fix memory leak Shannon Zhao
2015-06-17  2:59 ` [Qemu-devel] [PATCH v3 3/8] hw/sparc/leon3.c: " Shannon Zhao
2015-06-17  2:59 ` [Qemu-devel] [PATCH v3 4/8] hw/m68k/an5206.c: " Shannon Zhao
2015-06-17  2:59 ` [Qemu-devel] [PATCH v3 5/8] hw/sh4/r2d.c: " Shannon Zhao
2015-06-17  3:00 ` [Qemu-devel] [PATCH v3 6/8] hw/arm/palm.c: " Shannon Zhao
2015-06-17  3:00 ` [Qemu-devel] [PATCH v3 7/8] hw/arm/spitz.c: " Shannon Zhao
2015-06-17  3:00 ` [Qemu-devel] [PATCH v3 8/8] hw/arm/tosa.c: " Shannon Zhao
2015-06-17  7:30 ` [Qemu-devel] [PATCH v3 0/8] Add a member in MachineState to store irq array Michael Tokarev
2015-06-18 10:29   ` Shannon Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEgOgz7K6k=ZVCfaMVKr1PtBKLW4WidU59wk61YOsDiykGyi8w@mail.gmail.com' \
    --to=peter.crosthwaite@xilinx.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=shannon.zhao@linaro.org \
    --cc=zhaoshenglong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.