mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 23:04:20 +01:00
runtime-rs: Use vhost-net device by default
This patch set vhost-net as default backend of networking. It allows users to set `disable_vhost_net` to `true` to reenable virtio-net backend. Plus, which backend to use is a matter of hypervisor, runtime-rs will no longer need to know that. Fixes: #8608 Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
This commit is contained in:
@@ -12,7 +12,7 @@ use async_trait::async_trait;
|
||||
use hypervisor::device::device_manager::{do_handle_device, DeviceManager};
|
||||
use hypervisor::device::driver::NetworkConfig;
|
||||
use hypervisor::device::{DeviceConfig, DeviceType};
|
||||
use hypervisor::{Backend, Hypervisor, NetworkDevice};
|
||||
use hypervisor::{Hypervisor, NetworkDevice};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use super::endpoint_persist::{EndpointState, IpVlanEndpointState};
|
||||
@@ -57,7 +57,6 @@ impl IPVlanEndpoint {
|
||||
Ok(NetworkConfig {
|
||||
host_dev_name: iface.name.clone(),
|
||||
virt_iface_name: self.net_pair.virt_iface.name.clone(),
|
||||
backend: Backend::Virtio,
|
||||
guest_mac: Some(guest_mac),
|
||||
..Default::default()
|
||||
})
|
||||
|
||||
@@ -12,7 +12,7 @@ use async_trait::async_trait;
|
||||
use hypervisor::device::device_manager::{do_handle_device, DeviceManager};
|
||||
use hypervisor::device::driver::NetworkConfig;
|
||||
use hypervisor::device::{DeviceConfig, DeviceType};
|
||||
use hypervisor::{Backend, Hypervisor, NetworkDevice};
|
||||
use hypervisor::{Hypervisor, NetworkDevice};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use super::endpoint_persist::{EndpointState, MacvlanEndpointState};
|
||||
@@ -56,7 +56,6 @@ impl MacVlanEndpoint {
|
||||
Ok(NetworkConfig {
|
||||
host_dev_name: iface.name.clone(),
|
||||
virt_iface_name: self.net_pair.virt_iface.name.clone(),
|
||||
backend: Backend::Virtio,
|
||||
guest_mac: Some(guest_mac),
|
||||
..Default::default()
|
||||
})
|
||||
|
||||
@@ -10,7 +10,7 @@ use anyhow::{Context, Result};
|
||||
use async_trait::async_trait;
|
||||
use hypervisor::device::device_manager::{do_handle_device, DeviceManager};
|
||||
use hypervisor::device::{DeviceConfig, DeviceType};
|
||||
use hypervisor::{Backend, Hypervisor, NetworkConfig, NetworkDevice};
|
||||
use hypervisor::{Hypervisor, NetworkConfig, NetworkDevice};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use super::endpoint_persist::TapEndpointState;
|
||||
@@ -76,7 +76,6 @@ impl TapEndpoint {
|
||||
Ok(NetworkConfig {
|
||||
host_dev_name: self.tap_iface.name.clone(),
|
||||
virt_iface_name: self.name.clone(),
|
||||
backend: Backend::Virtio,
|
||||
guest_mac: Some(guest_mac),
|
||||
queue_num: self.queue_num,
|
||||
queue_size: self.queue_size,
|
||||
|
||||
@@ -12,7 +12,7 @@ use async_trait::async_trait;
|
||||
use hypervisor::device::device_manager::{do_handle_device, DeviceManager};
|
||||
use hypervisor::device::driver::NetworkConfig;
|
||||
use hypervisor::device::{DeviceConfig, DeviceType};
|
||||
use hypervisor::{Backend, Hypervisor, NetworkDevice};
|
||||
use hypervisor::{Hypervisor, NetworkDevice};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use super::endpoint_persist::{EndpointState, VethEndpointState};
|
||||
@@ -56,7 +56,6 @@ impl VethEndpoint {
|
||||
Ok(NetworkConfig {
|
||||
host_dev_name: iface.name.clone(),
|
||||
virt_iface_name: self.net_pair.virt_iface.name.clone(),
|
||||
backend: Backend::Virtio,
|
||||
guest_mac: Some(guest_mac),
|
||||
..Default::default()
|
||||
})
|
||||
|
||||
@@ -12,7 +12,7 @@ use async_trait::async_trait;
|
||||
use hypervisor::device::device_manager::{do_handle_device, DeviceManager};
|
||||
use hypervisor::device::driver::NetworkConfig;
|
||||
use hypervisor::device::{DeviceConfig, DeviceType};
|
||||
use hypervisor::{Backend, Hypervisor, NetworkDevice};
|
||||
use hypervisor::{Hypervisor, NetworkDevice};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use super::endpoint_persist::{EndpointState, VlanEndpointState};
|
||||
@@ -56,7 +56,6 @@ impl VlanEndpoint {
|
||||
Ok(NetworkConfig {
|
||||
host_dev_name: iface.name.clone(),
|
||||
virt_iface_name: self.net_pair.virt_iface.name.clone(),
|
||||
backend: Backend::Virtio,
|
||||
guest_mac: Some(guest_mac),
|
||||
..Default::default()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user