Implement copy for VmFrame

This commit is contained in:
Jianfeng Jiang
2023-07-20 15:32:50 +08:00
committed by Tate, Hongliang Tian
parent 38ee2cafcd
commit 3a3cb7cd15
2 changed files with 20 additions and 2 deletions

View File

@ -216,12 +216,12 @@ impl VmoInner {
if self.should_share_frame_with_parent(write_page) {
return Ok(inherited_frame);
}
let frame = {
let options = VmAllocOptions::new(1);
VmFrameVec::allocate(&options)?.pop().unwrap()
};
frame.write_bytes(0, &*tmp_buffer)?;
frame.copy_from_frame(&inherited_frame);
Ok(frame)
}