提交 8f77558f 编写于 作者: A Avi Kivity

memory: obsolete cpu_physical_memory_[gs]et_dirty_tracking()

The getter is no longer used, so it is completely removed.
Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 dc94a7ed
...@@ -251,7 +251,7 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque) ...@@ -251,7 +251,7 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque)
int ret; int ret;
if (stage < 0) { if (stage < 0) {
cpu_physical_memory_set_dirty_tracking(0); memory_global_dirty_log_stop();
return 0; return 0;
} }
...@@ -274,8 +274,7 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque) ...@@ -274,8 +274,7 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque)
} }
} }
/* Enable dirty memory tracking */ memory_global_dirty_log_start();
cpu_physical_memory_set_dirty_tracking(1);
qemu_put_be64(f, ram_bytes_total() | RAM_SAVE_FLAG_MEM_SIZE); qemu_put_be64(f, ram_bytes_total() | RAM_SAVE_FLAG_MEM_SIZE);
...@@ -320,7 +319,7 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque) ...@@ -320,7 +319,7 @@ int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque)
while ((bytes_sent = ram_save_block(f)) != 0) { while ((bytes_sent = ram_save_block(f)) != 0) {
bytes_transferred += bytes_sent; bytes_transferred += bytes_sent;
} }
cpu_physical_memory_set_dirty_tracking(0); memory_global_dirty_log_stop();
} }
qemu_put_be64(f, RAM_SAVE_FLAG_EOS); qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
......
...@@ -566,10 +566,6 @@ void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end, ...@@ -566,10 +566,6 @@ void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end,
int dirty_flags); int dirty_flags);
void cpu_tlb_update_dirty(CPUState *env); void cpu_tlb_update_dirty(CPUState *env);
int cpu_physical_memory_set_dirty_tracking(int enable);
int cpu_physical_memory_get_dirty_tracking(void);
void dump_exec_info(FILE *f, fprintf_function cpu_fprintf); void dump_exec_info(FILE *f, fprintf_function cpu_fprintf);
#endif /* !CONFIG_USER_ONLY */ #endif /* !CONFIG_USER_ONLY */
......
...@@ -61,6 +61,8 @@ static inline void cpu_register_physical_memory(target_phys_addr_t start_addr, ...@@ -61,6 +61,8 @@ static inline void cpu_register_physical_memory(target_phys_addr_t start_addr,
void qemu_register_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size); void qemu_register_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size);
void qemu_unregister_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size); void qemu_unregister_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size);
int cpu_physical_memory_set_dirty_tracking(int enable);
#endif #endif
#endif #endif
...@@ -2008,19 +2008,9 @@ int cpu_physical_memory_set_dirty_tracking(int enable) ...@@ -2008,19 +2008,9 @@ int cpu_physical_memory_set_dirty_tracking(int enable)
{ {
int ret = 0; int ret = 0;
in_migration = enable; in_migration = enable;
if (enable) {
memory_global_dirty_log_start();
} else {
memory_global_dirty_log_stop();
}
return ret; return ret;
} }
int cpu_physical_memory_get_dirty_tracking(void)
{
return in_migration;
}
static inline void tlb_update_dirty(CPUTLBEntry *tlb_entry) static inline void tlb_update_dirty(CPUTLBEntry *tlb_entry)
{ {
ram_addr_t ram_addr; ram_addr_t ram_addr;
......
...@@ -1493,6 +1493,7 @@ void memory_global_dirty_log_start(void) ...@@ -1493,6 +1493,7 @@ void memory_global_dirty_log_start(void)
{ {
MemoryListener *listener; MemoryListener *listener;
cpu_physical_memory_set_dirty_tracking(1);
global_dirty_log = true; global_dirty_log = true;
QLIST_FOREACH(listener, &memory_listeners, link) { QLIST_FOREACH(listener, &memory_listeners, link) {
listener->log_global_start(listener); listener->log_global_start(listener);
...@@ -1507,6 +1508,7 @@ void memory_global_dirty_log_stop(void) ...@@ -1507,6 +1508,7 @@ void memory_global_dirty_log_stop(void)
QLIST_FOREACH(listener, &memory_listeners, link) { QLIST_FOREACH(listener, &memory_listeners, link) {
listener->log_global_stop(listener); listener->log_global_stop(listener);
} }
cpu_physical_memory_set_dirty_tracking(0);
} }
static void listener_add_address_space(MemoryListener *listener, static void listener_add_address_space(MemoryListener *listener,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册