From: Hongyong Zang Date: Mon, 21 Nov 2011 10:56:18 +0000 (+0800) Subject: ivshmem: fix PCI BAR2 registration during initialization X-Git-Tag: qemu-xen-4.2.0~101 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ff51a738cf487811a7890d5292c38bc30eb54e45;p=qemu-upstream-4.2-testing.git 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 Signed-off-by: Hongyong Zang Signed-off-by: Anthony Liguori --- diff --git a/hw/ivshmem.c b/hw/ivshmem.c index a3a0e9845..7b4dbf66a 100644 --- a/hw/ivshmem.c +++ b/hw/ivshmem.c @@ -699,7 +699,7 @@ static int pci_ivshmem_init(PCIDevice *dev) s->peers = g_malloc0(s->nb_peers * sizeof(Peer)); 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 *));