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 <pmores@redhat.com>
Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
alex.lyn 2023-11-27 15:12:44 +08:00
parent e31dbc94a5
commit 1a6b45d3b7
2 changed files with 3 additions and 1 deletions

View File

@ -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 {

View File

@ -67,6 +67,7 @@ impl DragonballInner {
DeviceType::ShareFs(sharefs) => self
.add_share_fs_device(&sharefs.config)
.context("add share fs device"),
DeviceType::Vsock(_) => todo!(),
}
}