From eb06419c565fade8bbd8cc670423aa435cdf1d0c Mon Sep 17 00:00:00 2001 From: Vaibhav Nagarnaik Date: Wed, 18 May 2022 21:24:43 +0000 Subject: [PATCH] hypervisor: Switch inflate/deflate functions The methods names got switched in commit https://crrev.com/c/3640424. Switch them to the right names. BUG=b:213150327 TEST=compiled. Change-Id: I7f8df13367abc2314f26c9da206bcbd9665e8ba5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3654202 Commit-Queue: Vaibhav Nagarnaik Reviewed-by: Colin Downs-Razouk Reviewed-by: Daniel Verkamp Tested-by: kokoro Reviewed-by: Anton Romanov --- hypervisor/src/kvm/mod.rs | 4 ++-- hypervisor/src/lib.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index 6f8070a389..2fe46a2ee9 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -650,7 +650,7 @@ impl Vm for KvmVm { } } - fn handle_deflate(&mut self, guest_address: GuestAddress, size: u64) -> Result<()> { + fn handle_inflate(&mut self, guest_address: GuestAddress, size: u64) -> Result<()> { match self.guest_mem.remove_range(guest_address, size) { Ok(_) => Ok(()), Err(vm_memory::Error::MemoryAccess(_, MmapError::SystemCallFailed(e))) => Err(e), @@ -658,7 +658,7 @@ impl Vm for KvmVm { } } - fn handle_inflate(&mut self, _guest_address: GuestAddress, _size: u64) -> Result<()> { + fn handle_deflate(&mut self, _guest_address: GuestAddress, _size: u64) -> Result<()> { // No-op, when the guest attempts to access the pages again, Linux/KVM will provide them. Ok(()) } diff --git a/hypervisor/src/lib.rs b/hypervisor/src/lib.rs index b8d537e5e0..7059a2ebe0 100644 --- a/hypervisor/src/lib.rs +++ b/hypervisor/src/lib.rs @@ -169,15 +169,15 @@ pub trait Vm: Send { /// # Arguments /// * `guest_address` - Address in the guest's "physical" memory to begin the unmapping /// * `size` - The size of the region to unmap, in bytes - fn handle_deflate(&mut self, guest_address: GuestAddress, size: u64) -> Result<()>; + fn handle_inflate(&mut self, guest_address: GuestAddress, size: u64) -> Result<()>; /// Reallocates memory and maps it to provide to the guest. This is intended to be used - /// exclusively in tandem with `handle_deflate`, and will return an `Err` Result otherwise. + /// exclusively in tandem with `handle_inflate`, and will return an `Err` Result otherwise. /// /// # Arguments /// * `guest_address` - Address in the guest's "physical" memory to begin the mapping /// * `size` - The size of the region to map, in bytes - fn handle_inflate(&mut self, guest_address: GuestAddress, size: u64) -> Result<()>; + fn handle_deflate(&mut self, guest_address: GuestAddress, size: u64) -> Result<()>; } /// A unique fingerprint for a particular `VcpuRunHandle`, used in `Vcpu` impls to ensure the