/// Builds a network device to be attached when the VM starts.
Builds a network device to be attached when the VM starts.
Builds a network device to be attached when the VM starts .
pub fn build_net_device(
        &mut self,
        body: NetworkInterfaceConfig,
    ) -> Result<NetworkInterfaceError> {
        self.net_builder.build(body).map(|net_device| {
            // Update `Net` device `MmdsNetworkStack` IPv4 address.
            match &self.mmds_config {
                Some(cfg) => cfg.ipv4_addr().map_or((), |ipv4_addr| {
                    net_device
                        .lock()
                        .expect("Poisoned lock")
                        .set_mmds_ipv4_addr(ipv4_addr);
                }),
                None => (),
            };
        })
    }
pub fn build_net_device ( & mut self , body : NetworkInterfaceConfig , ) -> Result < NetworkInterfaceError > { self . net_builder . build ( body ) . map ( | net_device | { // Update `Net` device `MmdsNetworkStack` IPv4 address. match & self . mmds_config { Some ( cfg ) => cfg . ipv4_addr ( ) . map_or ( ( ) , | ipv4_addr | { net_device . lock ( ) . expect ( " " ) . set_mmds_ipv4_addr ( ipv4_addr ) ; } ) , None => ( ) , } ; } ) }
Builds a network device to be attached when the VM starts.
Builds a network device to be attached when the VM starts .
&mut self
body
NetworkInterfaceConfig