mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor, vmm: Abstract the interfaces to start/stop dirty log
Following KVM interfaces, the `hypervisor` crate now provides interfaces to start/stop the dirty pages logging on a per region basis, and asks its users (e.g. the `vmm` crate) to iterate over the regions that needs dirty pages log. MSHV only has a global control to start/stop dirty pages log on all regions at once. This patch refactors related APIs from the `hypervisor` crate to provide a global control to start/stop dirty pages log (following MSHV's behaviors), and keeps tracking the regions need dirty pages log for KVM. It avoids leaking hypervisor-specific behaviors out of the `hypervisor` crate. Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
@@ -281,21 +281,9 @@ pub trait Vm: Send + Sync {
|
||||
/// Set the VM state
|
||||
fn set_state(&self, state: VmState) -> Result<()>;
|
||||
/// Start logging dirty pages
|
||||
fn start_dirty_log(
|
||||
&self,
|
||||
slot: u32,
|
||||
guest_phys_addr: u64,
|
||||
memory_size: u64,
|
||||
userspace_addr: u64,
|
||||
) -> Result<()>;
|
||||
fn start_dirty_log(&self) -> Result<()>;
|
||||
/// Stop logging dirty pages
|
||||
fn stop_dirty_log(
|
||||
&self,
|
||||
slot: u32,
|
||||
guest_phys_addr: u64,
|
||||
memory_size: u64,
|
||||
userspace_addr: u64,
|
||||
) -> Result<()>;
|
||||
fn stop_dirty_log(&self) -> Result<()>;
|
||||
/// Get dirty pages bitmap
|
||||
fn get_dirty_log(&self, slot: u32, memory_size: u64) -> Result<Vec<u64>>;
|
||||
#[cfg(feature = "tdx")]
|
||||
|
||||
Reference in New Issue
Block a user