build: Bump vm-memory and dependents

vm-memory 0.18 has renamed GuestMemory to GuestMemoryBackend, and made
GuestMemory refer to something less specific.  For simplicity, we keep
using GuestMemoryBackend (formerly GuestMemory) everywhere for now.  We
can adjust bounds to be less specific later if we find ourselves needing
the newly enabled flexibility.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Alyssa Ross
2026-07-15 18:51:13 +02:00
committed by Rob Bradford
parent 1a1c21024a
commit cd2089eb69
33 changed files with 140 additions and 103 deletions

View File

@@ -30,8 +30,8 @@ use thiserror::Error;
use virtio_queue::{Queue, QueueT};
use vm_allocator::page_size::{align_page_size_down, get_page_size};
use vm_memory::{
Address, ByteValued, Bytes, GuestAddress, GuestAddressSpace, GuestMemory, GuestMemoryAtomic,
GuestMemoryError, GuestMemoryRegion,
Address, ByteValued, Bytes, GuestAddress, GuestAddressSpace, GuestMemoryAtomic,
GuestMemoryBackend, GuestMemoryError, GuestMemoryRegion,
};
use vm_migration::{Migratable, MigratableError, Pausable, Snapshot, Snapshottable, Transportable};
use vm_virtio::AccessPlatform;

View File

@@ -17,8 +17,8 @@ use thiserror::Error;
use virtio_queue::{DescriptorChain, Queue, QueueT};
use vm_device::dma_mapping::ExternalDmaMapping;
use vm_memory::{
Address, ByteValued, Bytes, GuestAddress, GuestAddressSpace, GuestMemory, GuestMemoryAtomic,
GuestMemoryError, GuestMemoryLoadGuard,
Address, ByteValued, Bytes, GuestAddress, GuestAddressSpace, GuestMemoryAtomic,
GuestMemoryBackend, GuestMemoryError, GuestMemoryLoadGuard,
};
use vm_migration::{Migratable, MigratableError, Pausable, Snapshot, Snapshottable, Transportable};
use vm_virtio::AccessPlatform;

View File

@@ -38,7 +38,7 @@ pub mod vsock;
pub mod watchdog;
use vm_memory::bitmap::AtomicBitmap;
use vm_memory::{GuestAddress, GuestMemory};
use vm_memory::{GuestAddress, GuestMemoryBackend};
use vm_virtio::VirtioDeviceType;
pub use self::balloon::Balloon;
@@ -180,12 +180,12 @@ impl TryInto<rate_limiter::RateLimiter> for RateLimiterConfig {
/// Return the host virtual address corresponding to the given guest address range
///
/// Convert an absolute address into an address space (GuestMemory)
/// Convert an absolute address into an address space (GuestMemoryBackend)
/// to a host pointer and verify that the provided size defines a valid
/// range within a single memory region.
/// Return None if it is out of bounds, spans multiple regions, or has
/// zero size at an unmapped GPA.
pub fn get_host_address_range<M: GuestMemory + ?Sized>(
pub fn get_host_address_range<M: GuestMemoryBackend + ?Sized>(
mem: &M,
addr: GuestAddress,
size: usize,

View File

@@ -29,8 +29,8 @@ use thiserror::Error;
use virtio_queue::{DescriptorChain, Queue, QueueT};
use vm_device::dma_mapping::ExternalDmaMapping;
use vm_memory::{
Address, ByteValued, Bytes, GuestAddress, GuestAddressSpace, GuestMemory, GuestMemoryAtomic,
GuestMemoryError, GuestMemoryLoadGuard, GuestMemoryRegion,
Address, ByteValued, Bytes, GuestAddress, GuestAddressSpace, GuestMemoryAtomic,
GuestMemoryBackend, GuestMemoryError, GuestMemoryLoadGuard, GuestMemoryRegion,
};
use vm_migration::protocol::MemoryRangeTable;
use vm_migration::{Migratable, MigratableError, Pausable, Snapshot, Snapshottable, Transportable};

View File

@@ -21,7 +21,7 @@ use vhost::{VhostBackend, VringConfigData};
use virtio_queue::desc::RawDescriptor;
use virtio_queue::{Queue, QueueT};
use vm_device::dma_mapping::ExternalDmaMapping;
use vm_memory::{GuestAddress, GuestAddressSpace, GuestMemoryAtomic};
use vm_memory::{GuestAddress, GuestAddressSpace, GuestMemoryAtomic, GuestMemoryBackend};
use vm_migration::{Migratable, MigratableError, Pausable, Snapshot, Snapshottable, Transportable};
use vm_virtio::{AccessPlatform, Translatable};
use vmm_sys_util::eventfd::EventFd;
@@ -564,7 +564,10 @@ impl<M: GuestAddressSpace> VdpaDmaMapping<M> {
}
}
impl<M: GuestAddressSpace + Sync + Send> ExternalDmaMapping for VdpaDmaMapping<M> {
impl<M: GuestAddressSpace + Sync + Send> ExternalDmaMapping for VdpaDmaMapping<M>
where
M::M: GuestMemoryBackend,
{
fn map(&self, iova: u64, gpa: u64, size: u64) -> result::Result<(), io::Error> {
let usize_size = size.try_into().unwrap();
let mem = self.memory.memory();

View File

@@ -23,7 +23,7 @@ use vhost::vhost_user::{Error as VhostUserError, FrontendReqHandler, VhostUserFr
use virtio_queue::{Error as QueueError, Queue};
use vm_memory::guest_memory::Error as MmapError;
use vm_memory::mmap::MmapRegionError;
use vm_memory::{Address, GuestAddressSpace, GuestMemory, GuestMemoryAtomic};
use vm_memory::{Address, GuestAddressSpace, GuestMemoryAtomic, GuestMemoryBackend};
use vm_migration::protocol::MemoryRangeTable;
use vm_migration::{MigratableError, Pausable, Snapshot};
use vmm_sys_util::eventfd::EventFd;

View File

@@ -27,7 +27,7 @@ use vhost::{
use virtio_queue::desc::RawDescriptor;
use virtio_queue::{Queue, QueueT};
use vm_memory::guest_memory::Error as MmapError;
use vm_memory::{Address, FileOffset, GuestAddress, GuestMemory, GuestMemoryRegion};
use vm_memory::{Address, FileOffset, GuestAddress, GuestMemoryBackend, GuestMemoryRegion};
use vm_migration::protocol::MemoryRangeTable;
use vmm_sys_util::epoll::{ControlOperation, Epoll, EpollEvent, EventSet};
use vmm_sys_util::eventfd::EventFd;

View File

@@ -22,7 +22,8 @@ use std::ops::Deref;
use byteorder::{ByteOrder, LittleEndian};
use virtio_queue::DescriptorChain;
use vm_memory::{
Address, Bytes, GuestAddress, GuestMemory, ReadVolatile, VolatileMemoryError, WriteVolatile,
Address, Bytes, GuestAddress, GuestMemoryBackend, ReadVolatile, VolatileMemoryError,
WriteVolatile,
};
use vm_virtio::AccessPlatform;
use vm_virtio::checked_descriptor::DescriptorChainExt;
@@ -502,7 +503,7 @@ impl VsockPacket {
/// Writes the local copy of the packet header to the guest memory.
///
pub fn commit_hdr<M: GuestMemory>(&mut self, guest_mem: &M) -> Result<()> {
pub fn commit_hdr<M: GuestMemoryBackend>(&mut self, guest_mem: &M) -> Result<()> {
self.validate_len()?;
guest_mem