mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
memory: Introduce log_sync_global() to memory listener
Some of the memory listener may want to do log synchronization without being able to specify a range of memory to sync but always globally. Such a memory listener should provide this new method instead of the log_sync() method. Obviously we can also achieve similar thing when we put the global sync logic into a log_sync() handler. However that's not efficient enough because otherwise memory_global_dirty_log_sync() may do the global sync N times, where N is the number of flat ranges in the address space. Make this new method be exclusive to log_sync(). Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20210506160549.130416-2-peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
70cbae429e
commit
b87eaa9b82
2 changed files with 35 additions and 10 deletions
|
@ -616,6 +616,18 @@ struct MemoryListener {
|
|||
*/
|
||||
void (*log_sync)(MemoryListener *listener, MemoryRegionSection *section);
|
||||
|
||||
/**
|
||||
* @log_sync_global:
|
||||
*
|
||||
* This is the global version of @log_sync when the listener does
|
||||
* not have a way to synchronize the log with finer granularity.
|
||||
* When the listener registers with @log_sync_global defined, then
|
||||
* its @log_sync must be NULL. Vice versa.
|
||||
*
|
||||
* @listener: The #MemoryListener.
|
||||
*/
|
||||
void (*log_sync_global)(MemoryListener *listener);
|
||||
|
||||
/**
|
||||
* @log_clear:
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue