virtio-devices: Create a proper result type for VirtioPciDevice

Creating a dedicated Result type for VirtioPciDevice, associated with
the new VirtioPciDeviceError enum. This allows for a clearer handling of
the errors generated through VirtioPciDevice::new().

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2022-11-23 15:01:16 +01:00
committed by Rob Bradford
parent eae8043890
commit a50b3784fe
3 changed files with 56 additions and 35 deletions

View File

@@ -226,7 +226,7 @@ pub enum DeviceManagerError {
UnRegisterIoevent(anyhow::Error),
/// Cannot create virtio device
VirtioDevice(vmm_sys_util::errno::Error),
VirtioDevice(virtio_devices::transport::VirtioPciDeviceError),
/// Cannot add PCI device
AddPciDevice(pci::PciRootError),