aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-09-22 16:11:54 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2016-10-24 15:27:19 +0200
commitd45fa784cd0c111131696808d1168259d66b7519 (patch)
tree594ab2fb8b35dbf97cdf7b74001d0baefd137306
parent0fe4fca4e1a5e06a270127dd80bb753d4dda61c6 (diff)
downloadqemu-d45fa784cd0c111131696808d1168259d66b7519.zip
qemu-d45fa784cd0c111131696808d1168259d66b7519.tar.gz
qemu-d45fa784cd0c111131696808d1168259d66b7519.tar.bz2
memory: eliminate global MemoryListeners
There is none, so just drop the code. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--include/exec/memory.h2
-rw-r--r--memory.c23
2 files changed, 7 insertions, 18 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 10d7eac..39f3410 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -255,7 +255,7 @@ struct MemoryListener {
hwaddr addr, hwaddr len);
/* Lower = earlier (during add), later (during del) */
unsigned priority;
- AddressSpace *address_space_filter;
+ AddressSpace *address_space;
QTAILQ_ENTRY(MemoryListener) link;
};
diff --git a/memory.c b/memory.c
index 58f9269..1886b44 100644
--- a/memory.c
+++ b/memory.c
@@ -100,8 +100,7 @@ enum ListenerDirection { Forward, Reverse };
static bool memory_listener_match(MemoryListener *listener,
MemoryRegionSection *section)
{
- return !listener->address_space_filter
- || listener->address_space_filter == section->address_space;
+ return listener->address_space == section->address_space;
}
#define MEMORY_LISTENER_CALL_GLOBAL(_callback, _direction, _args...) \
@@ -2176,9 +2175,7 @@ void memory_global_dirty_log_sync(void)
if (!listener->log_sync) {
continue;
}
- /* Global listeners are being phased out. */
- assert(listener->address_space_filter);
- as = listener->address_space_filter;
+ as = listener->address_space;
view = address_space_get_flatview(as);
FOR_EACH_FLAT_RANGE(fr, view) {
MemoryRegionSection mrs = section_from_flat_range(fr, as);
@@ -2218,11 +2215,6 @@ static void listener_add_address_space(MemoryListener *listener,
FlatView *view;
FlatRange *fr;
- if (listener->address_space_filter
- && listener->address_space_filter != as) {
- return;
- }
-
if (listener->begin) {
listener->begin(listener);
}
@@ -2255,12 +2247,11 @@ static void listener_add_address_space(MemoryListener *listener,
flatview_unref(view);
}
-void memory_listener_register(MemoryListener *listener, AddressSpace *filter)
+void memory_listener_register(MemoryListener *listener, AddressSpace *as)
{
MemoryListener *other = NULL;
- AddressSpace *as;
- listener->address_space_filter = filter;
+ listener->address_space = as;
if (QTAILQ_EMPTY(&memory_listeners)
|| listener->priority >= QTAILQ_LAST(&memory_listeners,
memory_listeners)->priority) {
@@ -2274,9 +2265,7 @@ void memory_listener_register(MemoryListener *listener, AddressSpace *filter)
QTAILQ_INSERT_BEFORE(other, listener, link);
}
- QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) {
- listener_add_address_space(listener, as);
- }
+ listener_add_address_space(listener, as);
}
void memory_listener_unregister(MemoryListener *listener)
@@ -2310,7 +2299,7 @@ static void do_address_space_destroy(AddressSpace *as)
address_space_destroy_dispatch(as);
QTAILQ_FOREACH(listener, &memory_listeners, link) {
- assert(listener->address_space_filter != as);
+ assert(listener->address_space != as);
}
flatview_unref(as->current_map);