From d88b1bf01c152cae589cb13c238c3c85cc67dcb0 Mon Sep 17 00:00:00 2001 From: wllenyj Date: Thu, 26 May 2022 17:29:50 +0800 Subject: [PATCH] dragonball: update vsock dependency 1. fix vsock device init failed 2. fix VsockDeviceConfigInfo not found Signed-off-by: wllenyj --- src/dragonball/src/api/v1/mod.rs | 4 +--- src/dragonball/src/api/v1/vmm_action.rs | 8 ++++---- src/dragonball/src/device_manager/vsock_dev_mgr.rs | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/dragonball/src/api/v1/mod.rs b/src/dragonball/src/api/v1/mod.rs index 2077c982e..99e3075eb 100644 --- a/src/dragonball/src/api/v1/mod.rs +++ b/src/dragonball/src/api/v1/mod.rs @@ -4,9 +4,7 @@ //! API Version 1 related data structures to configure the vmm. mod vmm_action; -pub use self::vmm_action::{ - VmmAction, VmmActionError, VmmData, VmmRequest, VmmResponse, VmmService, -}; +pub use self::vmm_action::*; /// Wrapper for configuring the microVM boot source. mod boot_source; diff --git a/src/dragonball/src/api/v1/vmm_action.rs b/src/dragonball/src/api/v1/vmm_action.rs index 6dedbfc28..2962994b4 100644 --- a/src/dragonball/src/api/v1/vmm_action.rs +++ b/src/dragonball/src/api/v1/vmm_action.rs @@ -17,20 +17,20 @@ use crate::vm::{CpuTopology, KernelConfigInfo, VmConfigInfo}; use crate::vmm::Vmm; #[cfg(feature = "virtio-blk")] -use crate::device_manager::blk_dev_mgr::{ +pub use crate::device_manager::blk_dev_mgr::{ BlockDeviceConfigInfo, BlockDeviceConfigUpdateInfo, BlockDeviceError, BlockDeviceMgr, }; #[cfg(feature = "virtio-fs")] -use crate::device_manager::fs_dev_mgr::{ +pub use crate::device_manager::fs_dev_mgr::{ FsDeviceConfigInfo, FsDeviceConfigUpdateInfo, FsDeviceError, FsDeviceMgr, FsMountConfigInfo, }; #[cfg(feature = "virtio-net")] -use crate::device_manager::virtio_net_dev_mgr::{ +pub use crate::device_manager::virtio_net_dev_mgr::{ VirtioNetDeviceConfigInfo, VirtioNetDeviceConfigUpdateInfo, VirtioNetDeviceError, VirtioNetDeviceMgr, }; #[cfg(feature = "virtio-vsock")] -use crate::device_manager::vsock_dev_mgr::{VsockDeviceConfigInfo, VsockDeviceError}; +pub use crate::device_manager::vsock_dev_mgr::{VsockDeviceConfigInfo, VsockDeviceError}; use super::*; diff --git a/src/dragonball/src/device_manager/vsock_dev_mgr.rs b/src/dragonball/src/device_manager/vsock_dev_mgr.rs index 5e49bbfb3..4f0f07413 100644 --- a/src/dragonball/src/device_manager/vsock_dev_mgr.rs +++ b/src/dragonball/src/device_manager/vsock_dev_mgr.rs @@ -88,6 +88,20 @@ pub struct VsockDeviceConfigInfo { pub use_generic_irq: Option, } +impl Default for VsockDeviceConfigInfo { + fn default() -> Self { + Self { + id: String::default(), + guest_cid: 0, + uds_path: None, + tcp_addr: None, + queue_size: Vec::from(QUEUE_SIZES), + use_shared_irq: None, + use_generic_irq: None, + } + } +} + impl VsockDeviceConfigInfo { /// Get number and size of queues supported. pub fn queue_sizes(&self) -> Vec {