diff options
author | Avi Kivity <avi@redhat.com> | 2012-02-08 21:36:02 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-02-29 13:44:42 +0200 |
commit | 50c1e1491e1981ecba14a477897681d8d0602500 (patch) | |
tree | b978d61c3b39d9ed2f811df18f13fad93097d372 /memory.h | |
parent | 4855d41a61301a04e54c074f1139040e4cb4dd00 (diff) | |
download | hqemu-50c1e1491e1981ecba14a477897681d8d0602500.zip hqemu-50c1e1491e1981ecba14a477897681d8d0602500.tar.gz |
memory: support stateless memory listeners
Current memory listeners are incremental; that is, they are expected to
maintain their own state, and receive callbacks for changes to that state.
This patch adds support for stateless listeners; these work by receiving
a ->begin() callback (which tells them that new state is coming), a
sequence of ->region_add() and ->region_nop() callbacks, and then a
->commit() callback which signifies the end of the new state. They should
ignore ->region_del() callbacks.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'memory.h')
-rw-r--r-- | memory.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -180,8 +180,11 @@ typedef struct MemoryListener MemoryListener; * Use with memory_listener_register() and memory_listener_unregister(). */ struct MemoryListener { + void (*begin)(MemoryListener *listener); + void (*commit)(MemoryListener *listener); void (*region_add)(MemoryListener *listener, MemoryRegionSection *section); void (*region_del)(MemoryListener *listener, MemoryRegionSection *section); + void (*region_nop)(MemoryListener *listener, MemoryRegionSection *section); void (*log_start)(MemoryListener *listener, MemoryRegionSection *section); void (*log_stop)(MemoryListener *listener, MemoryRegionSection *section); void (*log_sync)(MemoryListener *listener, MemoryRegionSection *section); |