memory: add API for observing updates to the physical memory map

Add an API that allows a client to observe changes in the global
memory map:
 - region added (possibly with logging enabled)
 - region removed (possibly with logging enabled)
 - logging started on a region
 - logging stopped on a region
 - global logging started
 - global logging removed

This API will eventually replace cpu_register_physical_memory_client().

Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Avi Kivity 2011-12-11 14:47:25 +02:00
parent 86e775c654
commit 7664e80c84
3 changed files with 145 additions and 0 deletions

5
exec.c
View file

@ -1762,6 +1762,11 @@ static int cpu_notify_sync_dirty_bitmap(target_phys_addr_t start,
static int cpu_notify_migration_log(int enable)
{
CPUPhysMemoryClient *client;
if (enable) {
memory_global_dirty_log_start();
} else {
memory_global_dirty_log_stop();
}
QLIST_FOREACH(client, &memory_client_list, list) {
int r = client->migration_log(client, enable);
if (r < 0)