[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init
From: |
Avi Kivity |
Subject: |
[Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init |
Date: |
Thu, 4 Aug 2011 16:05:57 +0300 |
From: "Michael S. Tsirkin" <address@hidden>
We originally did get config on map, so that
following write accesses are done on an updated config.
New memory API doesn't give us a callback
on map, and arguably, devices don't know when
cpu really can access there. So updating on
init seems cleaner.
Signed-off-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Avi Kivity <address@hidden>
---
hw/virtio-pci.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index d685243..ca1f12f 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -506,9 +506,6 @@ static void virtio_map(PCIDevice *pci_dev, int region_num,
register_ioport_read(addr, config_len, 1, virtio_pci_config_readb, proxy);
register_ioport_read(addr, config_len, 2, virtio_pci_config_readw, proxy);
register_ioport_read(addr, config_len, 4, virtio_pci_config_readl, proxy);
-
- if (vdev->config_len)
- vdev->get_config(vdev, vdev->config);
}
static void virtio_write_config(PCIDevice *pci_dev, uint32_t address,
@@ -689,6 +686,10 @@ void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice
*vdev)
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);
+
+ if (vdev->config_len) {
+ vdev->get_config(vdev, vdev->config);
+ }
}
static int virtio_blk_init_pci(PCIDevice *pci_dev)
--
1.7.5.3
- [Qemu-devel] [PATCH v3 00/39] Memory API, batch 2: PCI devices, Avi Kivity, 2011/08/04
- [Qemu-devel] [PATCH v3 02/39] pci: add API to get a BAR's mapped address, Avi Kivity, 2011/08/04
- [Qemu-devel] [PATCH v3 27/39] i6300esb: convert to memory API, Avi Kivity, 2011/08/04
- [Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init,
Avi Kivity <=
- Re: [Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init, Anthony Liguori, 2011/08/05
- Re: [Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init, Avi Kivity, 2011/08/07
- Re: [Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init, Michael S. Tsirkin, 2011/08/08
- Re: [Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init, Anthony Liguori, 2011/08/08
- Re: [Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init, Avi Kivity, 2011/08/08
- Re: [Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init, Michael S. Tsirkin, 2011/08/08
- Re: [Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init, Anthony Liguori, 2011/08/08
- Re: [Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init, Michael S. Tsirkin, 2011/08/08
- Re: [Qemu-devel] [PATCH v3 01/39] virtio-pci: get config on init, Anthony Liguori, 2011/08/08
[Qemu-devel] [PATCH v3 21/39] ahci: convert to memory API, Avi Kivity, 2011/08/04