From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGEIi-0004H0-BM for qemu-devel@nongnu.org; Mon, 24 Sep 2012 15:26:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGEIh-0001rT-CO for qemu-devel@nongnu.org; Mon, 24 Sep 2012 15:26:40 -0400 Received: from mail-ie0-f173.google.com ([209.85.223.173]:53991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGEIh-0001rE-7a for qemu-devel@nongnu.org; Mon, 24 Sep 2012 15:26:39 -0400 Received: by iea17 with SMTP id 17so6880836iea.4 for ; Mon, 24 Sep 2012 12:26:38 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1348513730-7485-2-git-send-email-sw@weilnetz.de> References: <1348513730-7485-1-git-send-email-sw@weilnetz.de> <1348513730-7485-2-git-send-email-sw@weilnetz.de> Date: Mon, 24 Sep 2012 20:26:38 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 1/3] irq: Add new function qemu_init_irqs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: "Peter A. G. Crosthwaite" , qemu-devel@nongnu.org On 24 September 2012 20:08, Stefan Weil 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