Patchwork [28/40] sysbus: set owner for MMIO regions

login
register
mail settings
Submitter Paolo Bonzini
Date May 7, 2013, 2:17 p.m.
Message ID <1367936238-12196-29-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/242374/
State New
Headers show

Comments

Paolo Bonzini - May 7, 2013, 2:17 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/core/sysbus.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
index 9004d8c..788696b 100644
--- a/hw/core/sysbus.c
+++ b/hw/core/sysbus.c
@@ -115,6 +115,8 @@  void sysbus_init_mmio(SysBusDevice *dev, MemoryRegion *memory)
     n = dev->num_mmio++;
     dev->mmio[n].addr = -1;
     dev->mmio[n].memory = memory;
+
+    memory_region_set_owner(dev->mmio[n].memory, OBJECT(dev));
 }
 
 MemoryRegion *sysbus_mmio_get_region(SysBusDevice *dev, int n)