Struct swap::SwapDeviceUffdSender
source · pub struct SwapDeviceUffdSender {
uffd_factory: Factory,
command_tube: SendTube,
sender: Tube,
receiver: Tube,
}
Expand description
Create a new userfaultfd and send it to the monitor process.
Fields§
§uffd_factory: Factory
§command_tube: SendTube
§sender: Tube
§receiver: Tube
Implementations§
source§impl SwapDeviceUffdSender
impl SwapDeviceUffdSender
fn new(command_tube: SendTube, uffd_factory: &UffdFactory) -> Result<Self>
sourcepub fn on_process_forked(self) -> Result<()>
pub fn on_process_forked(self) -> Result<()>
Create a new userfaultfd and send it to the monitor process.
This must be called as soon as a child process which may touch the guest memory is forked.
Userfaultfd(2) originally has UFFD_FEATURE_EVENT_FORK
. But it is not applicable to crosvm
since it does not support non-root user namespace.
Trait Implementations§
source§impl AsRawDescriptors for SwapDeviceUffdSender
impl AsRawDescriptors for SwapDeviceUffdSender
source§fn as_raw_descriptors(&self) -> Vec<RawDescriptor>
fn as_raw_descriptors(&self) -> Vec<RawDescriptor>
Returns the underlying raw descriptors. Read more
Auto Trait Implementations§
impl RefUnwindSafe for SwapDeviceUffdSender
impl Send for SwapDeviceUffdSender
impl Sync for SwapDeviceUffdSender
impl Unpin for SwapDeviceUffdSender
impl UnwindSafe for SwapDeviceUffdSender
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more