mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-29 05:13:54 -06:00
kvm: move kvm to use memory notifiers
remove direct kvm calls from exec.c, make kvm use memory notifiers framework instead. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
46dbef6ade
commit
7b8f3b7834
3 changed files with 35 additions and 30 deletions
17
exec.c
17
exec.c
|
@ -1988,12 +1988,6 @@ int cpu_physical_memory_set_dirty_tracking(int enable)
|
|||
{
|
||||
int ret = 0;
|
||||
in_migration = enable;
|
||||
if (kvm_enabled()) {
|
||||
ret = kvm_set_migration_log(enable);
|
||||
}
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
ret = cpu_notify_migration_log(!!enable);
|
||||
return ret;
|
||||
}
|
||||
|
@ -2006,14 +2000,8 @@ int cpu_physical_memory_get_dirty_tracking(void)
|
|||
int cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
|
||||
target_phys_addr_t end_addr)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret;
|
||||
|
||||
if (kvm_enabled()) {
|
||||
ret = kvm_physical_sync_dirty_bitmap(start_addr, end_addr);
|
||||
}
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
ret = cpu_notify_sync_dirty_bitmap(start_addr, end_addr);
|
||||
return ret;
|
||||
}
|
||||
|
@ -2426,9 +2414,6 @@ void cpu_register_physical_memory_offset(target_phys_addr_t start_addr,
|
|||
ram_addr_t orig_size = size;
|
||||
void *subpage;
|
||||
|
||||
if (kvm_enabled())
|
||||
kvm_set_phys_mem(start_addr, size, phys_offset);
|
||||
|
||||
cpu_notify_set_memory(start_addr, size, phys_offset);
|
||||
|
||||
if (phys_offset == IO_MEM_UNASSIGNED) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue