pub struct Vsock {
descriptor: File,
}
Expand description
Handle for running VHOST_VSOCK ioctls.
Fields§
§descriptor: File
Implementations§
Trait Implementations§
source§impl AsRawDescriptor for Vsock
impl AsRawDescriptor for Vsock
source§fn as_raw_descriptor(&self) -> RawDescriptor
fn as_raw_descriptor(&self) -> RawDescriptor
Returns the underlying raw descriptor. Read more
source§impl Vhost for Vsock
impl Vhost for Vsock
source§fn set_owner(&self) -> Result<()>
fn set_owner(&self) -> Result<()>
Set the current process as the owner of this file descriptor.
This must be run before any other vhost ioctls.
source§fn reset_owner(&self) -> Result<()>
fn reset_owner(&self) -> Result<()>
Give up ownership and reset the device to default values. Allows a subsequent call to
set_owner
to succeed.source§fn get_features(&self) -> Result<u64>
fn get_features(&self) -> Result<u64>
Get a bitmask of supported virtio/vhost features.
source§fn set_features(&self, features: u64) -> Result<()>
fn set_features(&self, features: u64) -> Result<()>
Inform the vhost subsystem which features to enable. This should be a subset of
supported features from VHOST_GET_FEATURES. Read more
source§fn set_mem_table(&self, mem: &GuestMemory) -> Result<()>
fn set_mem_table(&self, mem: &GuestMemory) -> Result<()>
Set the guest memory mappings for vhost to use.
source§fn set_vring_num(&self, queue_index: usize, num: u16) -> Result<()>
fn set_vring_num(&self, queue_index: usize, num: u16) -> Result<()>
Set the number of descriptors in the vring. Read more
source§fn set_vring_addr(
&self,
mem: &GuestMemory,
queue_max_size: u16,
queue_size: u16,
queue_index: usize,
flags: u32,
desc_addr: GuestAddress,
used_addr: GuestAddress,
avail_addr: GuestAddress,
log_addr: Option<GuestAddress>
) -> Result<()>
fn set_vring_addr( &self, mem: &GuestMemory, queue_max_size: u16, queue_size: u16, queue_index: usize, flags: u32, desc_addr: GuestAddress, used_addr: GuestAddress, avail_addr: GuestAddress, log_addr: Option<GuestAddress> ) -> Result<()>
Set the addresses for a given vring. Read more
source§fn set_vring_base(&self, queue_index: usize, num: u16) -> Result<()>
fn set_vring_base(&self, queue_index: usize, num: u16) -> Result<()>
Set the first index to look for available descriptors. Read more
source§fn get_vring_base(&self, queue_index: usize) -> Result<u16>
fn get_vring_base(&self, queue_index: usize) -> Result<u16>
Gets the index of the next available descriptor in the queue. Read more
source§fn set_vring_call(&self, queue_index: usize, event: &Event) -> Result<()>
fn set_vring_call(&self, queue_index: usize, event: &Event) -> Result<()>
Set the event to trigger when buffers have been used by the host. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Vsock
impl Send for Vsock
impl Sync for Vsock
impl Unpin for Vsock
impl UnwindSafe for Vsock
Blanket Implementations§
§impl<T> AsRawDescriptors for Twhere
T: AsRawDescriptor,
impl<T> AsRawDescriptors for Twhere
T: AsRawDescriptor,
§fn as_raw_descriptors(&self) -> Vec<i32>
fn as_raw_descriptors(&self) -> Vec<i32>
Returns the underlying raw descriptors. Read more
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