[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 3/8] virtio: Convert to msix_init_exclusive_bar()
From: |
Alex Williamson |
Subject: |
[Qemu-devel] [PATCH v3 3/8] virtio: Convert to msix_init_exclusive_bar() interface |
Date: |
Thu, 14 Jun 2012 12:16:10 -0600 |
User-agent: |
StGIT/0.14.3 |
Simple conversion.
Signed-off-by: Alex Williamson <address@hidden>
---
hw/virtio-pci.c | 15 +++++----------
hw/virtio-pci.h | 1 -
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 9342eed..3dca37f 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -782,13 +782,10 @@ void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice
*vdev)
pci_set_word(config + PCI_SUBSYSTEM_ID, vdev->device_id);
config[PCI_INTERRUPT_PIN] = 1;
- memory_region_init(&proxy->msix_bar, "virtio-msix", 4096);
- if (vdev->nvectors && !msix_init(&proxy->pci_dev, vdev->nvectors,
- &proxy->msix_bar, 1, 0)) {
- pci_register_bar(&proxy->pci_dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY,
- &proxy->msix_bar);
- } else
+ if (vdev->nvectors &&
+ msix_init_exclusive_bar(&proxy->pci_dev, vdev->nvectors, 1)) {
vdev->nvectors = 0;
+ }
proxy->pci_dev.config_write = virtio_write_config;
@@ -834,12 +831,10 @@ static int virtio_blk_init_pci(PCIDevice *pci_dev)
static int virtio_exit_pci(PCIDevice *pci_dev)
{
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
- int r;
memory_region_destroy(&proxy->bar);
- r = msix_uninit(pci_dev, &proxy->msix_bar);
- memory_region_destroy(&proxy->msix_bar);
- return r;
+ msix_uninit_exclusive_bar(pci_dev);
+ return 0;
}
static int virtio_blk_exit_pci(PCIDevice *pci_dev)
diff --git a/hw/virtio-pci.h b/hw/virtio-pci.h
index 91b791b..ac9d522 100644
--- a/hw/virtio-pci.h
+++ b/hw/virtio-pci.h
@@ -34,7 +34,6 @@ typedef struct {
PCIDevice pci_dev;
VirtIODevice *vdev;
MemoryRegion bar;
- MemoryRegion msix_bar;
uint32_t flags;
uint32_t class_code;
uint32_t nvectors;
- [Qemu-devel] [PATCH v3 0/8] msix: Support specifying offsets, BARs, and capability location, Alex Williamson, 2012/06/14
- [Qemu-devel] [PATCH v3 1/8] msix: Add simple BAR allocation MSIX setup functions, Alex Williamson, 2012/06/14
- [Qemu-devel] [PATCH v3 2/8] ivshmem: Convert to msix_init_exclusive_bar() interface, Alex Williamson, 2012/06/14
- [Qemu-devel] [PATCH v3 3/8] virtio: Convert to msix_init_exclusive_bar() interface,
Alex Williamson <=
- [Qemu-devel] [PATCH v3 4/8] msix: Move msix_mmio_read, Alex Williamson, 2012/06/14
- [Qemu-devel] [PATCH v3 5/8] msix: Note endian TODO item, Alex Williamson, 2012/06/14
- [Qemu-devel] [PATCH v3 6/8] msix: Split PBA into it's own MemoryRegion, Alex Williamson, 2012/06/14
- [Qemu-devel] [PATCH v3 7/8] msix: Allow full specification of MSIX layout, Alex Williamson, 2012/06/14
- [Qemu-devel] [PATCH v3 8/8] msix: Switch msix_uninit to return void, Alex Williamson, 2012/06/14
- Re: [Qemu-devel] [PATCH v3 0/8] msix: Support specifying offsets, BARs, and capability location, Michael S. Tsirkin, 2012/06/14
- Re: [Qemu-devel] [PATCH v3 0/8] msix: Support specifying offsets, BARs, and capability location, Jan Kiszka, 2012/06/18
- Re: [Qemu-devel] [PATCH v3 0/8] msix: Support specifying offsets, BARs, and capability location, Michael S. Tsirkin, 2012/06/18
- Re: [Qemu-devel] [PATCH v3 0/8] msix: Support specifying offsets, BARs, and capability location, Jan Kiszka, 2012/06/18
- Re: [Qemu-devel] [PATCH v3 0/8] msix: Support specifying offsets, BARs, and capability location, Michael S. Tsirkin, 2012/06/18