From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeO5q-0003uv-1Q for qemu-devel@nongnu.org; Tue, 22 Sep 2015 09:58:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeO5n-0005ni-7o for qemu-devel@nongnu.org; Tue, 22 Sep 2015 09:58:49 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:20540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeO5n-0005n1-0c for qemu-devel@nongnu.org; Tue, 22 Sep 2015 09:58:47 -0400 References: <1442333283-13119-1-git-send-email-marcandre.lureau@redhat.com> <1442333283-13119-11-git-send-email-marcandre.lureau@redhat.com> <56015DD4.8090903@huawei.com> From: Claudio Fontana Message-ID: <56015E8F.8010102@huawei.com> Date: Tue, 22 Sep 2015 15:58:39 +0200 MIME-Version: 1.0 In-Reply-To: <56015DD4.8090903@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v3 10/46] ivshmem: remove last exit(1) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org Cc: drjones@redhat.com, cam@cs.ualberta.ca, stefanha@redhat.com On 22.09.2015 15:55, Claudio Fontana wrote: > On 15.09.2015 18:07, marcandre.lureau@redhat.com wrote: >> From: Marc-André Lureau >> >> Failing to create a chardev shouldn't be fatal. >> >> Signed-off-by: Marc-André Lureau >> --- >> hw/misc/ivshmem.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c >> index 3af73a5..7ba93c0 100644 >> --- a/hw/misc/ivshmem.c >> +++ b/hw/misc/ivshmem.c >> @@ -299,7 +299,7 @@ static CharDriverState* create_eventfd_chr_device(void * opaque, EventNotifier * >> >> if (chr == NULL) { >> error_report("creating eventfd for eventfd %d failed", eventfd); >> - exit(1); >> + return NULL; >> } >> qemu_chr_fe_claim_no_fail(chr); >> >> > > I took a look at the eventfd_chr array in the IVShmemState, > and I noticed that it's allocated with malloc at some point for receiving interrupts > with g_malloc0 in pci_ivshmem_init, but it's never freed in pci_ivshmem_uninit. > > Is there such a change somewhere in the patchset I have missed? > > Have you checked that the resources allocated during pci_ivshmem_init are released on pci_ivshmem_uninit? With your patchset applied, that would be _realize and _exit, as changed by patch [PATCH v3 09/46] ivshmem: more qdev conversion Ciao,CLaudio