diff --git a/src/runtime-rs/crates/hypervisor/src/device/driver/vhost_user.rs b/src/runtime-rs/crates/hypervisor/src/device/driver/vhost_user.rs index 43b21a1756..f5545ecc6b 100644 --- a/src/runtime-rs/crates/hypervisor/src/device/driver/vhost_user.rs +++ b/src/runtime-rs/crates/hypervisor/src/device/driver/vhost_user.rs @@ -6,29 +6,20 @@ use crate::device::pci_path::PciPath; -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Default)] pub enum VhostUserType { /// Blk - represents a block vhostuser device type - /// "vhost-user-blk-pci" - Blk(String), + #[default] + Blk, /// SCSI - represents SCSI based vhost-user type - /// "vhost-user-scsi-pci" - SCSI(String), + SCSI, /// Net - represents Net based vhost-user type - /// "virtio-net-pci" - Net(String), + Net, /// FS - represents a virtio-fs vhostuser device type - /// "vhost-user-fs-pci" - FS(String), -} - -impl Default for VhostUserType { - fn default() -> Self { - VhostUserType::Blk("vhost-user-blk-pci".to_owned()) - } + FS, } #[derive(Debug, Clone, Default)] diff --git a/src/runtime-rs/crates/resource/src/volume/direct_volumes/spdk_volume.rs b/src/runtime-rs/crates/resource/src/volume/direct_volumes/spdk_volume.rs index 7e28de9cab..1ccf04a85d 100644 --- a/src/runtime-rs/crates/resource/src/volume/direct_volumes/spdk_volume.rs +++ b/src/runtime-rs/crates/resource/src/volume/direct_volumes/spdk_volume.rs @@ -75,7 +75,7 @@ impl SPDKVolume { let vhu_blk_config = &mut VhostUserConfig { socket_path: device, - device_type: VhostUserType::Blk("vhost-user-blk-pci".to_owned()), + device_type: VhostUserType::Blk, driver_option: block_driver, ..Default::default() };