From patchwork Mon Mar 18 16:37:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fred.konrad@greensocs.com X-Patchwork-Id: 228701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 950022C00BC for ; Tue, 19 Mar 2013 03:53:42 +1100 (EST) Received: from localhost ([::1]:33740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHdJc-0001RN-Rb for incoming@patchwork.ozlabs.org; Mon, 18 Mar 2013 12:53:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHdJF-0001Ea-Cc for qemu-devel@nongnu.org; Mon, 18 Mar 2013 12:53:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHd4G-0001he-U7 for qemu-devel@nongnu.org; Mon, 18 Mar 2013 12:37:56 -0400 Received: from greensocs.com ([87.106.252.221]:57969 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHd4G-0001hQ-Lw for qemu-devel@nongnu.org; Mon, 18 Mar 2013 12:37:48 -0400 Received: from localhost (unknown [127.0.0.1]) by s15328186.onlinehome-server.info (Postfix) with ESMTP id 2B8E743EE36; Mon, 18 Mar 2013 16:37:48 +0000 (UTC) Received: from s15328186.onlinehome-server.info ([127.0.0.1]) by localhost (s15328186.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QBs1NLTo9xpx; Mon, 18 Mar 2013 17:37:46 +0100 (CET) Received: by s15328186.onlinehome-server.info (Postfix, from userid 491) id A4CE744D685; Mon, 18 Mar 2013 17:37:45 +0100 (CET) Received: from compaq.katmai.xl.cx.katmai.xl.cx (lan31-11-83-155-143-136.fbx.proxad.net [83.155.143.136]) by s15328186.onlinehome-server.info (Postfix) with ESMTPSA id 37D8243EE36; Mon, 18 Mar 2013 17:37:44 +0100 (CET) From: fred.konrad@greensocs.com To: qemu-devel@nongnu.org, aliguori@us.ibm.com Date: Mon, 18 Mar 2013 17:37:20 +0100 Message-Id: <1363624648-16906-4-git-send-email-fred.konrad@greensocs.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1363624648-16906-1-git-send-email-fred.konrad@greensocs.com> References: <1363624648-16906-1-git-send-email-fred.konrad@greensocs.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 87.106.252.221 Cc: peter.maydell@linaro.org, mst@redhat.com, mark.burton@greensocs.com, cornelia.huck@de.ibm.com, afaerber@suse.de, fred.konrad@greensocs.com Subject: [Qemu-devel] [PATCH v10 03/11] virtio-pci: fix hot unplug. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: KONRAD Frederic Hot unplug failed because it tried to free the virtio device two times. This fix the issue by removing the call to virtio_bus_destroy_device. Signed-off-by: KONRAD Frederic --- hw/virtio-pci.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index c795cc6..f0dd823 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -1412,13 +1412,6 @@ static void virtio_pci_device_plugged(DeviceState *d) proxy->host_features); } -/* This is called by virtio-bus just before the device is unplugged. */ -static void virtio_pci_device_unplug(DeviceState *d) -{ - VirtIOPCIProxy *dev = VIRTIO_PCI(d); - virtio_pci_stop_ioeventfd(dev); -} - static int virtio_pci_init(PCIDevice *pci_dev) { VirtIOPCIProxy *dev = VIRTIO_PCI(pci_dev); @@ -1433,10 +1426,7 @@ static int virtio_pci_init(PCIDevice *pci_dev) static void virtio_pci_exit(PCIDevice *pci_dev) { VirtIOPCIProxy *proxy = VIRTIO_PCI(pci_dev); - VirtioBusState *bus = VIRTIO_BUS(&proxy->bus); - BusState *qbus = BUS(&proxy->bus); - virtio_bus_destroy_device(bus); - qbus_free(qbus); + virtio_pci_stop_ioeventfd(proxy); virtio_exit_pci(pci_dev); } @@ -1503,7 +1493,6 @@ static void virtio_pci_bus_class_init(ObjectClass *klass, void *data) k->set_guest_notifiers = virtio_pci_set_guest_notifiers; k->vmstate_change = virtio_pci_vmstate_change; k->device_plugged = virtio_pci_device_plugged; - k->device_unplug = virtio_pci_device_unplug; } static const TypeInfo virtio_pci_bus_info = {