@@ -14,7 +14,6 @@ use std::io::{ErrorKind, Write};
14
14
use std:: sync:: atomic:: { AtomicBool , AtomicU16 , AtomicU32 , AtomicUsize , Ordering } ;
15
15
use std:: sync:: { Arc , Barrier , Mutex } ;
16
16
17
- use anyhow:: anyhow;
18
17
use kvm_ioctls:: { IoEventAddress , NoDatamatch } ;
19
18
use log:: warn;
20
19
use pci:: {
@@ -39,7 +38,7 @@ use crate::devices::virtio::transport::{VirtioInterrupt, VirtioInterruptType};
39
38
use crate :: logger:: { debug, error} ;
40
39
use crate :: pci:: configuration:: { PciCapability , PciConfiguration , PciConfigurationState } ;
41
40
use crate :: pci:: msix:: { MsixCap , MsixConfig , MsixConfigState } ;
42
- use crate :: pci:: { BarReprogrammingParams , PciDevice } ;
41
+ use crate :: pci:: { BarReprogrammingParams , DeviceRelocationError , PciDevice } ;
43
42
use crate :: snapshot:: Persist ;
44
43
use crate :: utils:: u64_to_usize;
45
44
use crate :: vstate:: bus:: BusDevice ;
@@ -251,7 +250,7 @@ pub struct VirtioPciDeviceState {
251
250
#[ derive( Debug , thiserror:: Error , displaydoc:: Display ) ]
252
251
pub enum VirtioPciDeviceError {
253
252
/// Failed creating VirtioPciDevice: {0}
254
- CreateVirtioPciDevice ( #[ from] anyhow :: Error ) ,
253
+ CreateVirtioPciDevice ( #[ from] DeviceRelocationError ) ,
255
254
/// Error creating MSI configuration: {0}
256
255
Msi ( #[ from] InterruptError ) ,
257
256
}
@@ -782,7 +781,7 @@ impl PciDevice for VirtioPciDevice {
782
781
self . configuration . detect_bar_reprogramming ( reg_idx, data)
783
782
}
784
783
785
- fn move_bar ( & mut self , old_base : u64 , new_base : u64 ) -> Result < ( ) , anyhow :: Error > {
784
+ fn move_bar ( & mut self , old_base : u64 , new_base : u64 ) -> Result < ( ) , DeviceRelocationError > {
786
785
// We only update our idea of the bar in order to support free_bars() above.
787
786
// The majority of the reallocation is done inside DeviceManager.
788
787
if self . bar_address == old_base {
0 commit comments