Patchwork [v2,05/17] pci: set owner for BARs

login
register
mail settings
Submitter Paolo Bonzini
Date June 4, 2013, 12:13 p.m.
Message ID <1370348041-6768-6-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/248593/
State New
Headers show

Comments

Paolo Bonzini - June 4, 2013, 12:13 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/pci/pci.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 26851ac..776ad96 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -913,6 +913,8 @@  void pci_register_bar(PCIDevice *pci_dev, int region_num,
     uint64_t wmask;
     pcibus_t size = memory_region_size(memory);
 
+    memory_region_set_owner(memory, OBJECT(pci_dev));
+
     assert(region_num >= 0);
     assert(region_num < PCI_NUM_REGIONS);
     if (size & (size-1)) {