mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Add support for adding a single memory region
Assuming vhost-user devices support CONFIGURE_MEM_SLOTS protocol feature, we introduce a new method to the VirtioDevice trait in order to update one single memory at a time. In case CONFIGURE_MEM_SLOTS is not supported by the backend (feature not acked), we fallback onto the current way of updating the memory mappings, that is with SET_MEM_TABLE. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -16,7 +16,7 @@ use std::sync::{
|
||||
Arc, Barrier,
|
||||
};
|
||||
use std::thread;
|
||||
use vm_memory::{GuestAddress, GuestMemoryAtomic, GuestMemoryMmap, GuestUsize};
|
||||
use vm_memory::{GuestAddress, GuestMemoryAtomic, GuestMemoryMmap, GuestRegionMmap, GuestUsize};
|
||||
use vm_migration::{MigratableError, Pausable};
|
||||
use vm_virtio::VirtioDeviceType;
|
||||
use vmm_sys_util::eventfd::EventFd;
|
||||
@@ -143,6 +143,13 @@ pub trait VirtioDevice: Send {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn add_memory_region(
|
||||
&mut self,
|
||||
_region: &Arc<GuestRegionMmap>,
|
||||
) -> std::result::Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Returns the list of userspace mappings associated with this device.
|
||||
fn userspace_mappings(&self) -> Vec<UserspaceMapping> {
|
||||
Vec::new()
|
||||
|
||||
Reference in New Issue
Block a user