mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-06 02:24:44 +00:00
dragonball: Minor changes to comments
Changes include: - Merge `VhostNetDeviceError` import item. - Replace if with match in `add_vhost_net_device()` Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
This commit is contained in:
parent
a047331a34
commit
3e0614cdf0
@ -37,9 +37,9 @@ pub use crate::device_manager::fs_dev_mgr::{
|
|||||||
#[cfg(feature = "virtio-mem")]
|
#[cfg(feature = "virtio-mem")]
|
||||||
pub use crate::device_manager::mem_dev_mgr::{MemDeviceConfigInfo, MemDeviceError};
|
pub use crate::device_manager::mem_dev_mgr::{MemDeviceConfigInfo, MemDeviceError};
|
||||||
#[cfg(feature = "vhost-net")]
|
#[cfg(feature = "vhost-net")]
|
||||||
use crate::device_manager::vhost_net_dev_mgr::VhostNetDeviceError;
|
pub use crate::device_manager::vhost_net_dev_mgr::{
|
||||||
#[cfg(feature = "vhost-net")]
|
VhostNetDeviceConfigInfo, VhostNetDeviceError, VhostNetDeviceMgr,
|
||||||
pub use crate::device_manager::vhost_net_dev_mgr::{VhostNetDeviceConfigInfo, VhostNetDeviceMgr};
|
};
|
||||||
#[cfg(feature = "virtio-net")]
|
#[cfg(feature = "virtio-net")]
|
||||||
pub use crate::device_manager::virtio_net_dev_mgr::{
|
pub use crate::device_manager::virtio_net_dev_mgr::{
|
||||||
VirtioNetDeviceConfigInfo, VirtioNetDeviceConfigUpdateInfo, VirtioNetDeviceError,
|
VirtioNetDeviceConfigInfo, VirtioNetDeviceConfigUpdateInfo, VirtioNetDeviceError,
|
||||||
@ -706,14 +706,12 @@ impl VmmService {
|
|||||||
let vm = vmm.get_vm_mut().ok_or(VmmActionError::InvalidVMID)?;
|
let vm = vmm.get_vm_mut().ok_or(VmmActionError::InvalidVMID)?;
|
||||||
let ctx = vm
|
let ctx = vm
|
||||||
.create_device_op_context(Some(event_mgr.epoll_manager()))
|
.create_device_op_context(Some(event_mgr.epoll_manager()))
|
||||||
.map_err(|err| {
|
.map_err(|err| match err {
|
||||||
if let StartMicroVmError::MicroVMAlreadyRunning = err {
|
StartMicroVmError::MicroVMAlreadyRunning => {
|
||||||
VmmActionError::VhostNet(VhostNetDeviceError::UpdateNotAllowedPostBoot)
|
VmmActionError::VhostNet(VhostNetDeviceError::UpdateNotAllowedPostBoot)
|
||||||
} else if let StartMicroVmError::UpcallServerNotReady = err {
|
|
||||||
VmmActionError::UpcallServerNotReady
|
|
||||||
} else {
|
|
||||||
VmmActionError::StartMicroVm(err)
|
|
||||||
}
|
}
|
||||||
|
StartMicroVmError::UpcallServerNotReady => VmmActionError::UpcallServerNotReady,
|
||||||
|
_ => VmmActionError::StartMicroVm(err),
|
||||||
})?;
|
})?;
|
||||||
VhostNetDeviceMgr::insert_device(vm.device_manager_mut(), ctx, config)
|
VhostNetDeviceMgr::insert_device(vm.device_manager_mut(), ctx, config)
|
||||||
.map(|_| VmmData::Empty)
|
.map(|_| VmmData::Empty)
|
||||||
|
Loading…
Reference in New Issue
Block a user