pub struct VirtioDeviceConfig {
pub device_type: VirtioDeviceType,
pub config: Vec<u8>,
pub path: Option<String>,
pub read_only: bool,
pub tag: Option<String>,
pub net_fd: Option<i32>,
}Expand description
VirtIO device configuration for attaching to a VM.
Fields§
§device_type: VirtioDeviceTypeDevice type.
config: Vec<u8>Device-specific configuration.
path: Option<String>Path to device (for block/fs devices).
read_only: boolWhether the device is read-only.
tag: Option<String>Tag for filesystem devices.
net_fd: Option<i32>File descriptor for file-handle-based network attachment.
Implementations§
Source§impl VirtioDeviceConfig
impl VirtioDeviceConfig
Sourcepub fn block(path: impl Into<String>, read_only: bool) -> Self
pub fn block(path: impl Into<String>, read_only: bool) -> Self
Creates a new block device configuration.
Sourcepub const fn network_file_handle(fd: i32) -> Self
pub const fn network_file_handle(fd: i32) -> Self
Creates a network device configuration with file-handle attachment.
The VZ framework side uses one connected datagram socket file descriptor for bidirectional frame I/O.
Trait Implementations§
Source§impl Clone for VirtioDeviceConfig
impl Clone for VirtioDeviceConfig
Source§fn clone(&self) -> VirtioDeviceConfig
fn clone(&self) -> VirtioDeviceConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VirtioDeviceConfig
impl Debug for VirtioDeviceConfig
Source§impl<'de> Deserialize<'de> for VirtioDeviceConfig
impl<'de> Deserialize<'de> for VirtioDeviceConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for VirtioDeviceConfig
impl RefUnwindSafe for VirtioDeviceConfig
impl Send for VirtioDeviceConfig
impl Sync for VirtioDeviceConfig
impl Unpin for VirtioDeviceConfig
impl UnsafeUnpin for VirtioDeviceConfig
impl UnwindSafe for VirtioDeviceConfig
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