qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: fred.konrad@greensocs.com
To: qemu-devel@nongnu.org, aliguori@us.ibm.com
Cc: cornelia.huck@de.ibm.com, peter.maydell@linaro.org,
	mark.burton@greensocs.com, fred.konrad@greensocs.com
Subject: [Qemu-devel] [PATCH v4 3/7] virtio-pci: cleanup.
Date: Wed, 24 Apr 2013 10:21:19 +0200	[thread overview]
Message-ID: <1366791683-5350-4-git-send-email-fred.konrad@greensocs.com> (raw)
In-Reply-To: <1366791683-5350-1-git-send-email-fred.konrad@greensocs.com>

From: KONRAD Frederic <fred.konrad@greensocs.com>

This remove the init, exit functions as they are no longer used.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
---
 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 6278427..c87ec10 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -885,57 +885,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)
 {
@@ -1054,7 +1003,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 35ae6ac..917bcc5 100644
--- a/hw/virtio/virtio-pci.h
+++ b/hw/virtio/virtio-pci.h
@@ -200,8 +200,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
 
-- 
1.7.11.7

  parent reply	other threads:[~2013-04-24  8:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24  8:21 [Qemu-devel] [PATCH v4 0/7] virtio-refactoring cleanup fred.konrad
2013-04-24  8:21 ` [Qemu-devel] [PATCH v4 1/7] virtio-bus: add new functions fred.konrad
2013-04-24  8:21 ` [Qemu-devel] [PATCH v4 2/7] virtio-bus: make virtio_x_bus_new static fred.konrad
2013-04-24  8:21 ` fred.konrad [this message]
2013-04-24  8:21 ` [Qemu-devel] [PATCH v4 4/7] virtio: remove the function pointer fred.konrad
2013-04-24  8:21 ` [Qemu-devel] [PATCH v4 5/7] virtio: remove virtiobindings fred.konrad
2013-04-24  8:21 ` [Qemu-devel] [PATCH v4 6/7] virtio: cleanup: init and exit function fred.konrad
2013-04-24  8:21 ` [Qemu-devel] [PATCH v4 7/7] virtio: drop unused function prototypes fred.konrad
2013-04-24 18:24 ` [Qemu-devel] [PATCH v4 0/7] virtio-refactoring cleanup Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366791683-5350-4-git-send-email-fred.konrad@greensocs.com \
    --to=fred.konrad@greensocs.com \
    --cc=aliguori@us.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=mark.burton@greensocs.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).