[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 58/61] virtio-pci : cleanup : init, exit and reset f
From: |
fred . konrad |
Subject: |
[Qemu-devel] [PATCH 58/61] virtio-pci : cleanup : init, exit and reset functions. |
Date: |
Mon, 7 Jan 2013 19:41:11 +0100 |
From: KONRAD Frederic <address@hidden>
This remove the init, exit and reset functions as they are no longer used. The
new API virtio_pci_rst function is renamed virtio_pci_reset.
Signed-off-by: KONRAD Frederic <address@hidden>
---
hw/virtio-pci.c | 71 ++++-----------------------------------------------------
hw/virtio-pci.h | 3 ---
2 files changed, 4 insertions(+), 70 deletions(-)
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index c47b9b1..4588073 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -257,15 +257,6 @@ static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy
*proxy)
proxy->ioeventfd_started = false;
}
-void virtio_pci_reset(DeviceState *d)
-{
- VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d);
- virtio_pci_stop_ioeventfd(proxy);
- virtio_reset(proxy->vdev);
- msix_unuse_all_vectors(&proxy->pci_dev);
- proxy->flags &= ~VIRTIO_PCI_FLAG_BUS_MASTER_BUG;
-}
-
static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
{
VirtIOPCIProxy *proxy = opaque;
@@ -734,57 +725,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);
-}
-
/*
* virtio-pci : This is the PCIDevice which have a virtio-pci-bus.
*/
@@ -904,14 +844,11 @@ static void virtio_pci_exit(PCIDevice *pci_dev)
BusState *qbus = BUS(proxy->bus);
virtio_bus_destroy_device(bus);
qbus_free(qbus);
- virtio_exit_pci(pci_dev);
+ memory_region_destroy(&proxy->bar);
+ msix_uninit_exclusive_bar(pci_dev);
}
-/*
- * This will be renamed virtio_pci_reset at the end of the series.
- * virtio_pci_reset is still in use at this moment.
- */
-static void virtio_pci_rst(DeviceState *qdev)
+static void virtio_pci_reset(DeviceState *qdev)
{
VirtIOPCIProxy *proxy = VIRTIO_PCI(qdev);
VirtioBusState *bus = VIRTIO_BUS(proxy->bus);
@@ -931,7 +868,7 @@ static void virtio_pci_class_init(ObjectClass *klass, void
*data)
k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
k->revision = VIRTIO_PCI_ABI_VERSION;
k->class_id = PCI_CLASS_OTHERS;
- dc->reset = virtio_pci_rst;
+ dc->reset = virtio_pci_reset;
}
static const TypeInfo virtio_pci_info = {
diff --git a/hw/virtio-pci.h b/hw/virtio-pci.h
index e251d93..4acddfd 100644
--- a/hw/virtio-pci.h
+++ b/hw/virtio-pci.h
@@ -161,9 +161,6 @@ struct VirtIOSerialPCI {
virtio_serial_conf serial;
};
-void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev);
-void virtio_pci_reset(DeviceState *d);
-
/* Virtio ABI version, if we increment this, we break the guest driver. */
#define VIRTIO_PCI_ABI_VERSION 0
--
1.7.11.7
- [Qemu-devel] [PATCH 48/61] virtio-serial-pci : switch to the new API., (continued)
- [Qemu-devel] [PATCH 48/61] virtio-serial-pci : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 50/61] virtio-serial : cleanup : init and exit functions., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 42/61] virtio-rng-pci : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 47/61] virtio-serial : add the virtio-serial device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 61/61] virtio : cleanup : init and exit function., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 51/61] virtio-serial : cleanup : use QOM casts., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 56/61] virtio-9p : cleanup : QOM casts., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 59/61] s390-virtio-bus : cleanup, fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 57/61] virtio : remove the function pointer., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 22/61] virtio-scsi : show the VirtIOSCSI structure., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 58/61] virtio-pci : cleanup : init, exit and reset functions.,
fred . konrad <=
- [Qemu-devel] [PATCH 53/61] virtio-9p : add the virtio-9p device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 25/61] virtio-scsi : moving host_features from properties to transport properties., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 55/61] virtio-9p : cleanup : init function., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 54/61] virtio-9p-pci : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 60/61] virtio : remove virtiobindings., fred . konrad, 2013/01/07
- Re: [Qemu-devel] [PATCH 00/61] Virtio refactoring., Anthony Liguori, 2013/01/07