runtime-rs: Simplify VhostUserType enum

Remove unused string parameter from each item.

Fixes: #8625

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
This commit is contained in:
Xuewei Niu
2023-12-25 14:31:35 +08:00
parent 38eb4077a6
commit 374c2f01aa
2 changed files with 7 additions and 16 deletions

View File

@@ -6,29 +6,20 @@
use crate::device::pci_path::PciPath; use crate::device::pci_path::PciPath;
#[derive(Debug, Clone)] #[derive(Debug, Clone, Default)]
pub enum VhostUserType { pub enum VhostUserType {
/// Blk - represents a block vhostuser device type /// Blk - represents a block vhostuser device type
/// "vhost-user-blk-pci" #[default]
Blk(String), Blk,
/// SCSI - represents SCSI based vhost-user type /// SCSI - represents SCSI based vhost-user type
/// "vhost-user-scsi-pci" SCSI,
SCSI(String),
/// Net - represents Net based vhost-user type /// Net - represents Net based vhost-user type
/// "virtio-net-pci" Net,
Net(String),
/// FS - represents a virtio-fs vhostuser device type /// FS - represents a virtio-fs vhostuser device type
/// "vhost-user-fs-pci" FS,
FS(String),
}
impl Default for VhostUserType {
fn default() -> Self {
VhostUserType::Blk("vhost-user-blk-pci".to_owned())
}
} }
#[derive(Debug, Clone, Default)] #[derive(Debug, Clone, Default)]

View File

@@ -75,7 +75,7 @@ impl SPDKVolume {
let vhu_blk_config = &mut VhostUserConfig { let vhu_blk_config = &mut VhostUserConfig {
socket_path: device, socket_path: device,
device_type: VhostUserType::Blk("vhost-user-blk-pci".to_owned()), device_type: VhostUserType::Blk,
driver_option: block_driver, driver_option: block_driver,
..Default::default() ..Default::default()
}; };