From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55688 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5FSk-00058E-Sv for qemu-devel@nongnu.org; Mon, 11 Oct 2010 06:18:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P5FSk-00043k-02 for qemu-devel@nongnu.org; Mon, 11 Oct 2010 06:18:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P5FSj-00043d-QL for qemu-devel@nongnu.org; Mon, 11 Oct 2010 06:18:33 -0400 Message-ID: <4CB2E498.3070008@redhat.com> Date: Mon, 11 Oct 2010 12:19:04 +0200 From: Kevin Wolf MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: virtio_cleanup() missing in virtio-{blk, balloon, 9p}-pci List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Venkateswararao Jujjuri , qemu-devel@nongnu.org, Adam Litke Am 11.10.2010 12:00, schrieb Markus Armbruster: > Pattern: > > FOO's PCIDeviceInfo method exit is virtio_FOO_exit_pci(), which calls > virtio_FOO_exit() and virtio_exit_pci(). > > virtio_{net,serial}_exit() call virtio_cleanup(). > > virtio_blk_exit() doesn't. Why? > > virtio-balloon-pci uses virtio_exit_pci() as exit method. No > virtio_cleanup()? > > virtio-9p-pci doesn't have an exit method. Doesn't feel right. > > I suspect these three leak memory or worse on hot unplug. Yes, virtio-blk seems to leak memory there. We should probably also cancel all running requests before removing the disk. I suspect not doing this could cause some segfaults when the AIO callback wants to access a disk that doesn't exist any more. Kevin