mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-04-01 20:04:37 +00:00
vm-virtio: Add update_memory() to VirtioDevice trait
The virtio devices backed by a vhost-user backend must send an update to the associated backend with the new file descriptors corresponding to the memory regions. This patch allows such devices to be notified when such update needs to happen. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
93becca82a
commit
bc874a9b6f
@ -6,7 +6,7 @@
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
|
||||
|
||||
use super::*;
|
||||
use crate::{ActivateResult, Error, Queue};
|
||||
use std::sync::Arc;
|
||||
use vm_memory::{GuestAddress, GuestMemoryAtomic, GuestMemoryMmap, GuestUsize};
|
||||
use vmm_sys_util::eventfd::EventFd;
|
||||
@ -106,6 +106,10 @@ pub trait VirtioDevice: Send {
|
||||
/// every device as part of shutting down the VM. Acting on the device
|
||||
/// after a shutdown() can lead to unpredictable results.
|
||||
fn shutdown(&mut self) {}
|
||||
|
||||
fn update_memory(&mut self, _mem: &GuestMemoryMmap) -> std::result::Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait providing address translation the same way a physical DMA remapping
|
||||
|
@ -175,4 +175,5 @@ pub enum Error {
|
||||
EpollCtl(io::Error),
|
||||
EpollWait(io::Error),
|
||||
FailedSignalingDriver(io::Error),
|
||||
VhostUserUpdateMemory(vhost_user::Error),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user