提交 b2357c48 编写于 作者: A Alex Williamson 提交者: Michael S. Tsirkin

virtio: Convert to msix_init_exclusive_bar() interface

Simple conversion.
Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 1116b539
...@@ -782,13 +782,10 @@ void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev) ...@@ -782,13 +782,10 @@ void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev)
pci_set_word(config + PCI_SUBSYSTEM_ID, vdev->device_id); pci_set_word(config + PCI_SUBSYSTEM_ID, vdev->device_id);
config[PCI_INTERRUPT_PIN] = 1; config[PCI_INTERRUPT_PIN] = 1;
memory_region_init(&proxy->msix_bar, "virtio-msix", 4096); if (vdev->nvectors &&
if (vdev->nvectors && !msix_init(&proxy->pci_dev, vdev->nvectors, msix_init_exclusive_bar(&proxy->pci_dev, vdev->nvectors, 1)) {
&proxy->msix_bar, 1, 0)) {
pci_register_bar(&proxy->pci_dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY,
&proxy->msix_bar);
} else
vdev->nvectors = 0; vdev->nvectors = 0;
}
proxy->pci_dev.config_write = virtio_write_config; proxy->pci_dev.config_write = virtio_write_config;
...@@ -834,12 +831,10 @@ static int virtio_blk_init_pci(PCIDevice *pci_dev) ...@@ -834,12 +831,10 @@ static int virtio_blk_init_pci(PCIDevice *pci_dev)
static int virtio_exit_pci(PCIDevice *pci_dev) static int virtio_exit_pci(PCIDevice *pci_dev)
{ {
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
int r;
memory_region_destroy(&proxy->bar); memory_region_destroy(&proxy->bar);
r = msix_uninit(pci_dev, &proxy->msix_bar); msix_uninit_exclusive_bar(pci_dev);
memory_region_destroy(&proxy->msix_bar); return 0;
return r;
} }
static int virtio_blk_exit_pci(PCIDevice *pci_dev) static int virtio_blk_exit_pci(PCIDevice *pci_dev)
......
...@@ -34,7 +34,6 @@ typedef struct { ...@@ -34,7 +34,6 @@ typedef struct {
PCIDevice pci_dev; PCIDevice pci_dev;
VirtIODevice *vdev; VirtIODevice *vdev;
MemoryRegion bar; MemoryRegion bar;
MemoryRegion msix_bar;
uint32_t flags; uint32_t flags;
uint32_t class_code; uint32_t class_code;
uint32_t nvectors; uint32_t nvectors;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册