From 1a6b45d3b758752a030b261ce257bd9e5561dd5a Mon Sep 17 00:00:00 2001 From: "alex.lyn" Date: Mon, 27 Nov 2023 15:12:44 +0800 Subject: [PATCH] runtime-rs: Reintroduce Vsock and add it to the DeviceType enum As vsock device will be used in Qemu or other VMMs, the Vsoock is reintroduced to DeviceType enum. Fixes: #8474 Signed-off-by: Pavel Mores Signed-off-by: alex.lyn --- src/runtime-rs/crates/hypervisor/src/device/mod.rs | 3 ++- .../crates/hypervisor/src/dragonball/inner_device.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime-rs/crates/hypervisor/src/device/mod.rs b/src/runtime-rs/crates/hypervisor/src/device/mod.rs index b40f784ddb..71b9575dbe 100644 --- a/src/runtime-rs/crates/hypervisor/src/device/mod.rs +++ b/src/runtime-rs/crates/hypervisor/src/device/mod.rs @@ -10,7 +10,7 @@ use crate::device::driver::vhost_user_blk::VhostUserBlkDevice; use crate::{ BlockConfig, BlockDevice, HybridVsockConfig, HybridVsockDevice, Hypervisor as hypervisor, NetworkConfig, NetworkDevice, ShareFsConfig, ShareFsDevice, VfioConfig, VfioDevice, - VhostUserConfig, VsockConfig, + VhostUserConfig, VsockConfig, VsockDevice, }; use anyhow::Result; use async_trait::async_trait; @@ -38,6 +38,7 @@ pub enum DeviceType { Network(NetworkDevice), ShareFs(ShareFsDevice), HybridVsock(HybridVsockDevice), + Vsock(VsockDevice), } impl fmt::Display for DeviceType { diff --git a/src/runtime-rs/crates/hypervisor/src/dragonball/inner_device.rs b/src/runtime-rs/crates/hypervisor/src/dragonball/inner_device.rs index 7f86b4d3a8..9484d3dc42 100644 --- a/src/runtime-rs/crates/hypervisor/src/dragonball/inner_device.rs +++ b/src/runtime-rs/crates/hypervisor/src/dragonball/inner_device.rs @@ -67,6 +67,7 @@ impl DragonballInner { DeviceType::ShareFs(sharefs) => self .add_share_fs_device(&sharefs.config) .context("add share fs device"), + DeviceType::Vsock(_) => todo!(), } }