Patchwork [12/23] fixup: listener fixes

login
register
mail settings
Submitter Avi Kivity
Date Dec. 19, 2011, 2:13 p.m.
Message ID <1324304024-11220-13-git-send-email-avi@redhat.com>
Download mbox | patch
Permalink /patch/132253/
State New
Headers show

Comments

Avi Kivity - Dec. 19, 2011, 2:13 p.m.
---
 memory.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Patch

diff --git a/memory.c b/memory.c
index c08186d..2dcbf80 100644
--- a/memory.c
+++ b/memory.c
@@ -708,13 +708,13 @@  static void memory_listener_update_region(FlatRange *fr, AddressSpace *as,
         .address_space = as->root,
         .offset_within_region = fr->offset_in_region,
         .size = int128_get64(fr->addr.size),
-        .offset_within_region = int128_get64(fr->addr.start),
+        .offset_within_address_space = int128_get64(fr->addr.start),
     };
     MemoryListener *listener;
 
     QLIST_FOREACH(listener, &memory_listeners, link) {
         ListenerCallback *callback
-            = *(ListenerCallback *)((void *)listener + callback_offset);
+            = *(ListenerCallback **)((void *)listener + callback_offset);
         callback(listener, &section);
     }
 }
@@ -1149,6 +1149,7 @@  void memory_region_sync_dirty_bitmap(MemoryRegion *mr)
 
     FOR_EACH_FLAT_RANGE(fr, &address_space_memory.current_map) {
         if (fr->mr == mr) {
+            MEMORY_LISTENER_UPDATE_REGION(fr, &address_space_memory, log_sync);
             cpu_physical_sync_dirty_bitmap(int128_get64(fr->addr.start),
                                            int128_get64(addrrange_end(fr->addr)));
         }
@@ -1467,7 +1468,7 @@  static void listener_add_address_space(MemoryListener *listener,
             .address_space = as->root,
             .offset_within_region = fr->offset_in_region,
             .size = int128_get64(fr->addr.size),
-            .offset_within_region = int128_get64(fr->addr.start),
+            .offset_within_address_space = int128_get64(fr->addr.start),
         };
         listener->region_add(listener, &section);
     }