From patchwork Sun Apr 14 21:26:32 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: 236479 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 E11132C009D for ; Mon, 15 Apr 2013 07:29:52 +1000 (EST) Received: from localhost ([::1]:42176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URUUh-0000ZU-4D for incoming@patchwork.ozlabs.org; Sun, 14 Apr 2013 17:29:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URURu-0004Lg-TU for qemu-devel@nongnu.org; Sun, 14 Apr 2013 17:27:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URURt-00053r-Px for qemu-devel@nongnu.org; Sun, 14 Apr 2013 17:26:58 -0400 Received: from greensocs.com ([87.106.252.221]:42666 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URURt-00053k-F1 for qemu-devel@nongnu.org; Sun, 14 Apr 2013 17:26:57 -0400 Received: from localhost (unknown [127.0.0.1]) by s15328186.onlinehome-server.info (Postfix) with ESMTP id BF2F340EC60; Sun, 14 Apr 2013 21:26:56 +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 b300nMIA95VR; Sun, 14 Apr 2013 23:26:52 +0200 (CEST) Received: by s15328186.onlinehome-server.info (Postfix, from userid 491) id EDAFF400091; Sun, 14 Apr 2013 23:26:47 +0200 (CEST) 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 0662940B250; Sun, 14 Apr 2013 23:26:46 +0200 (CEST) From: fred.konrad@greensocs.com To: qemu-devel@nongnu.org, aliguori@us.ibm.com Date: Sun, 14 Apr 2013 23:26:32 +0200 Message-Id: <1365974797-13217-4-git-send-email-fred.konrad@greensocs.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1365974797-13217-1-git-send-email-fred.konrad@greensocs.com> References: <1365974797-13217-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: cornelia.huck@de.ibm.com, peter.maydell@linaro.org, mark.burton@greensocs.com, fred.konrad@greensocs.com Subject: [Qemu-devel] [PATCH v3 3/8] virtio-pci: cleanup. 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 This remove the init, exit functions as they are no longer used. Signed-off-by: KONRAD Frederic --- hw/virtio/virtio-pci.c | 54 ++------------------------------------------------ hw/virtio/virtio-pci.h | 2 -- 2 files changed, 2 insertions(+), 54 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 6ea0a17..c330ebb 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -884,57 +884,6 @@ static const VirtIOBindings virtio_pci_bindings = { .vmstate_change = virtio_pci_vmstate_change, }; -void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev) -{ - uint8_t *config; - uint32_t size; - - proxy->vdev = vdev; - - config = proxy->pci_dev.config; - - if (proxy->class_code) { - pci_config_set_class(config, proxy->class_code); - } - pci_set_word(config + PCI_SUBSYSTEM_VENDOR_ID, - pci_get_word(config + PCI_VENDOR_ID)); - pci_set_word(config + PCI_SUBSYSTEM_ID, vdev->device_id); - config[PCI_INTERRUPT_PIN] = 1; - - if (vdev->nvectors && - msix_init_exclusive_bar(&proxy->pci_dev, vdev->nvectors, 1)) { - vdev->nvectors = 0; - } - - proxy->pci_dev.config_write = virtio_write_config; - - size = VIRTIO_PCI_REGION_SIZE(&proxy->pci_dev) + vdev->config_len; - if (size & (size-1)) - size = 1 << qemu_fls(size); - - memory_region_init_io(&proxy->bar, &virtio_pci_config_ops, proxy, - "virtio-pci", size); - pci_register_bar(&proxy->pci_dev, 0, PCI_BASE_ADDRESS_SPACE_IO, - &proxy->bar); - - if (!kvm_has_many_ioeventfds()) { - proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD; - } - - virtio_bind_device(vdev, &virtio_pci_bindings, DEVICE(proxy)); - proxy->host_features |= 0x1 << VIRTIO_F_NOTIFY_ON_EMPTY; - proxy->host_features |= 0x1 << VIRTIO_F_BAD_FEATURE; - proxy->host_features = vdev->get_features(vdev, proxy->host_features); -} - -static void virtio_exit_pci(PCIDevice *pci_dev) -{ - VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); - - memory_region_destroy(&proxy->bar); - msix_uninit_exclusive_bar(pci_dev); -} - #ifdef CONFIG_VIRTFS static int virtio_9p_init_pci(VirtIOPCIProxy *vpci_dev) { @@ -1053,7 +1002,8 @@ static void virtio_pci_exit(PCIDevice *pci_dev) { VirtIOPCIProxy *proxy = VIRTIO_PCI(pci_dev); virtio_pci_stop_ioeventfd(proxy); - virtio_exit_pci(pci_dev); + memory_region_destroy(&proxy->bar); + msix_uninit_exclusive_bar(pci_dev); } static void virtio_pci_reset(DeviceState *qdev) diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h index 4305774..c46ee77 100644 --- a/hw/virtio/virtio-pci.h +++ b/hw/virtio/virtio-pci.h @@ -182,8 +182,6 @@ struct VirtIORngPCI { VirtIORNG vdev; }; -void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev); - /* Virtio ABI version, if we increment this, we break the guest driver. */ #define VIRTIO_PCI_ABI_VERSION 0