hypervisor: Add ability to get dirty logged pages

Return a bitmap of pages that have been dirtied (written to) since it
was last called.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2020-11-11 18:32:03 +00:00
parent 8baa244ec1
commit 041724a7cf
2 changed files with 15 additions and 0 deletions

View File

@@ -369,6 +369,14 @@ impl vm::Vm for KvmVm {
self.vmmops.store(Some(Arc::new(vmmops)));
Ok(())
}
///
/// Get dirty pages bitmap (one bit per page)
///
fn get_dirty_log(&self, slot: u32, memory_size: u64) -> vm::Result<Vec<u64>> {
self.fd
.get_dirty_log(slot, memory_size as usize)
.map_err(|e| vm::HypervisorVmError::GetDirtyLog(e.into()))
}
}
/// Wrapper over KVM system ioctls.
pub struct KvmHypervisor {