Skip to content

Commit f0420e0

Browse files
author
Serban Iorga
committed
[vm_memory] remove unused methods
Signed-off-by: Serban Iorga <[email protected]>
1 parent ba06486 commit f0420e0

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

src/vm-memory/src/mmap.rs

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -339,27 +339,15 @@ impl GuestMemoryRegion for GuestRegionMmap {
339339
self.mapping.file_offset()
340340
}
341341

342-
// TODO: This implementation is temporary.
343-
// We need to return None here once we refactor vsock.
344342
unsafe fn as_slice(&self) -> Option<&[u8]> {
345-
// This is safe because we mapped the area at addr ourselves, so this slice will not
346-
// overflow. However, it is possible to alias.
347-
Some(std::slice::from_raw_parts(
348-
self.mapping.as_ptr(),
349-
self.mapping.size(),
350-
))
343+
// We don't use this method.
344+
None
351345
}
352346

353-
// TODO: This implementation is temporary.
354-
// We need to return None here once we refactor vsock.
355347
#[allow(clippy::mut_from_ref)]
356348
unsafe fn as_mut_slice(&self) -> Option<&mut [u8]> {
357-
// This is safe because we mapped the area at addr ourselves, so this slice will not
358-
// overflow. However, it is possible to alias.
359-
Some(std::slice::from_raw_parts_mut(
360-
self.mapping.as_ptr(),
361-
self.mapping.size(),
362-
))
349+
// We don't use this method.
350+
None
363351
}
364352

365353
fn get_host_address(&self, addr: MemoryRegionAddress) -> guest_memory::Result<*mut u8> {
@@ -370,15 +358,13 @@ impl GuestMemoryRegion for GuestRegionMmap {
370358
.map(|addr| self.as_ptr().wrapping_offset(addr.raw_value() as isize))
371359
}
372360

373-
// TODO: This implementation is temporary.
374-
// We need to return None here once we refactor vsock.
375361
fn get_slice(
376362
&self,
377-
offset: MemoryRegionAddress,
378-
count: usize,
363+
_offset: MemoryRegionAddress,
364+
_count: usize,
379365
) -> guest_memory::Result<VolatileSlice> {
380-
let slice = self.mapping.get_slice(offset.raw_value() as usize, count)?;
381-
Ok(slice)
366+
// We don't use this method.
367+
Err(guest_memory::Error::HostAddressNotAvailable)
382368
}
383369

384370
fn as_volatile_slice(&self) -> guest_memory::Result<VolatileSlice> {

tests/integration_tests/build/test_binary_size.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"aarch64": {
2222
"FC_BINARY_SIZE_TARGET": 2024744,
2323
"JAILER_BINARY_SIZE_TARGET": 1338312,
24-
"FC_BINARY_SIZE_LIMIT": 2030000,
24+
"FC_BINARY_SIZE_LIMIT": 2070000,
2525
"JAILER_BINARY_SIZE_LIMIT": 1511488,
2626
}
2727
}

tests/integration_tests/build/test_coverage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# this contains the frequency while on AMD it does not.
2525
# Checkout the cpuid crate. In the future other
2626
# differences may appear.
27-
COVERAGE_DICT = {"Intel": 85.42, "AMD": 84.84, "ARM": 83.74}
27+
COVERAGE_DICT = {"Intel": 85.42, "AMD": 84.84, "ARM": 83.63}
2828

2929
PROC_MODEL = proc.proc_type()
3030

0 commit comments

Comments
 (0)