summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@citrix.com>2012-04-04 15:15:41 +0100
committerAvi Kivity <avi@redhat.com>2012-04-05 13:09:17 +0300
commit221b3a3f1e5edb9e41a48bfa384803800184b397 (patch)
treeaaea8496cf7a9102069fb06ba965d484a4dc6b64
parentb9f9be88385e9ab51d4163bfd66f015f14f56286 (diff)
downloadfocaccia-qemu-221b3a3f1e5edb9e41a48bfa384803800184b397.tar.gz
focaccia-qemu-221b3a3f1e5edb9e41a48bfa384803800184b397.zip
memory: check address space when a listener is registered
This patch resolves a bug in memory listener registration.
"range_add" callback  was called on each section of the both
address space (IO and memory space) even if it doesn't match
the address space filter.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--memory.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index a3f5b59990..aab4a31323 100644
--- a/memory.c
+++ b/memory.c
@@ -1444,6 +1444,11 @@ static void listener_add_address_space(MemoryListener *listener,
 {
     FlatRange *fr;
 
+    if (listener->address_space_filter
+        && listener->address_space_filter != as->root) {
+        return;
+    }
+
     if (global_dirty_log) {
         listener->log_global_start(listener);
     }