runtime-rs: Make VhostUserConfig's field pci_path type more specific

Make VhostUserConfig pci_path's type more specific, change it
from Option<String> to Option<PciPath>.

Fixes: #8665

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
alex.lyn 2023-12-22 10:35:38 +08:00
parent 5cc2890a10
commit 82d3cfdeda

View File

@ -4,6 +4,8 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// //
use crate::device::pci_path::PciPath;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum VhostUserType { pub enum VhostUserType {
/// Blk - represents a block vhostuser device type /// Blk - represents a block vhostuser device type
@ -50,8 +52,8 @@ pub struct VhostUserConfig {
pub device_type: VhostUserType, pub device_type: VhostUserType,
/// guest block driver /// guest block driver
pub driver_option: String, pub driver_option: String,
/// pci_addr is the PCI address used to identify the slot at which the drive is attached. /// pci_path is the PCI Path used to identify the slot at which the device is attached.
pub pci_addr: Option<String>, pub pci_path: Option<PciPath>,
/// Block index of the device if assigned /// Block index of the device if assigned
/// type u64 is not OK /// type u64 is not OK