From patchwork Tue Oct 12 12:18:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 67546 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D1754B70A6 for ; Tue, 12 Oct 2010 23:19:47 +1100 (EST) Received: from localhost ([127.0.0.1]:51799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5dpX-00085g-QO for incoming@patchwork.ozlabs.org; Tue, 12 Oct 2010 08:19:43 -0400 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 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9CCIjHu013060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 12 Oct 2010 08:18:45 -0400 Received: from blackfin.pond.sub.org (ovpn-113-29.phx2.redhat.com [10.3.113.29]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id o9CCIiwe012570; Tue, 12 Oct 2010 08:18:44 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 500) id 53E2486; Tue, 12 Oct 2010 14:18:43 +0200 (CEST) From: Markus Armbruster To: "M. Mohan Kumar" 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: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Kevin Wolf , Venkateswararao Jujjuri , qemu-devel@nongnu.org, Adam Litke X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org "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,