Received: from [140.186.70.92] (port=34803 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5dol-00084e-Jx for qemu-devel@nongnu.org; Tue, 12 Oct 2010 08:18:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P5dok-0003gt-RM for qemu-devel@nongnu.org; Tue, 12 Oct 2010 08:18:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P5dok-0003gj-KK for qemu-devel@nongnu.org; Tue, 12 Oct 2010 08:18:54 -0400 From: Markus Armbruster Subject: Re: [Qemu-devel] virtio_cleanup() missing in virtio-{blk, balloon, 9p}-pci References: <201010121729.55760.mohan@in.ibm.com> Date: Tue, 12 Oct 2010 14:18:43 +0200 In-Reply-To: <201010121729.55760.mohan@in.ibm.com> (M. Mohan Kumar's message of "Tue, 12 Oct 2010 17:29:55 +0530") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "M. Mohan Kumar" Cc: Kevin Wolf , Venkateswararao Jujjuri , qemu-devel@nongnu.org, Adam Litke "M. Mohan Kumar" writes: >> 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. > > 9p does not support hot-plug now. We will implement virtio_9p_exit when we are > adding support for hot-plug If hot plug is not expected to work, perhaps the driver should refuse it. Untested sketch: diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 729917d..b09d85d 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -683,6 +683,11 @@ static int virtio_9p_init_pci(PCIDevice *pci_dev) VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); VirtIODevice *vdev; + if (pci_dev->qdev.hotplugged) { + error_report("Device doesn't support hot plug"); + return -1; + } + vdev = virtio_9p_init(&pci_dev->qdev, &proxy->fsconf); virtio_init_pci(proxy, vdev, PCI_VENDOR_ID_REDHAT_QUMRANET,