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:
@@ -879,13 +879,7 @@ impl vm::Vm for MshvVm {
|
||||
///
|
||||
/// Start logging dirty pages
|
||||
///
|
||||
fn start_dirty_log(
|
||||
&self,
|
||||
_slot: u32,
|
||||
_guest_phys_addr: u64,
|
||||
_memory_size: u64,
|
||||
_userspace_addr: u64,
|
||||
) -> vm::Result<()> {
|
||||
fn start_dirty_log(&self) -> vm::Result<()> {
|
||||
Err(vm::HypervisorVmError::StartDirtyLog(anyhow!(
|
||||
"functionality not implemented"
|
||||
)))
|
||||
@@ -893,13 +887,7 @@ impl vm::Vm for MshvVm {
|
||||
///
|
||||
/// Stop logging dirty pages
|
||||
///
|
||||
fn stop_dirty_log(
|
||||
&self,
|
||||
_slot: u32,
|
||||
_guest_phys_addr: u64,
|
||||
_memory_size: u64,
|
||||
_userspace_addr: u64,
|
||||
) -> vm::Result<()> {
|
||||
fn stop_dirty_log(&self) -> vm::Result<()> {
|
||||
Err(vm::HypervisorVmError::StopDirtyLog(anyhow!(
|
||||
"functionality not implemented"
|
||||
)))
|
||||
|
||||
Reference in New Issue
Block a user