From: Julien Grall Date: Wed, 4 Apr 2012 14:15:41 +0000 (+0100) Subject: memory: check address space when a listener is registered X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=221b3a3f1e5edb9e41a48bfa384803800184b397;p=qemu.git 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 Signed-off-by: Avi Kivity --- 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); }