Pārlūkot izejas kodu

ivshmem: fix PCI BAR2 registration during initialization

Ivshmem cannot work, and the command lspci cannot show ivshmem BAR2 in the guest.
As for pci_register_bar(), parameter MemoryRegion should be s->bar instead of s->ivshmem.

Reviewed-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Hongyong Zang <zanghongyong@huawei.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Hongyong Zang 13 gadi atpakaļ
vecāks
revīzija
ff51a738cf
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      hw/ivshmem.c

+ 1 - 1
hw/ivshmem.c

@@ -699,7 +699,7 @@ static int pci_ivshmem_init(PCIDevice *dev)
         s->peers = g_malloc0(s->nb_peers * sizeof(Peer));
         s->peers = g_malloc0(s->nb_peers * sizeof(Peer));
 
 
         pci_register_bar(&s->dev, 2,
         pci_register_bar(&s->dev, 2,
-                         PCI_BASE_ADDRESS_SPACE_MEMORY, &s->ivshmem);
+                         PCI_BASE_ADDRESS_SPACE_MEMORY, &s->bar);
 
 
         s->eventfd_chr = g_malloc0(s->vectors * sizeof(CharDriverState *));
         s->eventfd_chr = g_malloc0(s->vectors * sizeof(CharDriverState *));