@@ -255,7 +255,6 @@ pub enum VirtioPciDeviceError {
255
255
/// Error creating MSI configuration: {0}
256
256
Msi ( #[ from] InterruptError ) ,
257
257
}
258
- pub type Result < T > = std:: result:: Result < T , VirtioPciDeviceError > ;
259
258
260
259
pub struct VirtioPciDevice {
261
260
id : String ,
@@ -370,7 +369,7 @@ impl VirtioPciDevice {
370
369
device : Arc < Mutex < dyn VirtioDevice > > ,
371
370
msix_vectors : Arc < MsixVectorGroup > ,
372
371
pci_device_bdf : u32 ,
373
- ) -> Result < Self > {
372
+ ) -> Result < Self , VirtioPciDeviceError > {
374
373
let num_queues = device. lock ( ) . expect ( "Poisoned lock" ) . queues ( ) . len ( ) ;
375
374
376
375
let msix_config = Arc :: new ( Mutex :: new ( MsixConfig :: new (
@@ -419,7 +418,7 @@ impl VirtioPciDevice {
419
418
vm : & Arc < Vm > ,
420
419
device : Arc < Mutex < dyn VirtioDevice > > ,
421
420
state : VirtioPciDeviceState ,
422
- ) -> Result < Self > {
421
+ ) -> Result < Self , VirtioPciDeviceError > {
423
422
let msix_config =
424
423
MsixConfig :: from_state ( state. msix_state , vm. clone ( ) , state. pci_device_bdf . into ( ) ) ?;
425
424
let vectors = msix_config. vectors . clone ( ) ;
@@ -603,7 +602,7 @@ impl VirtioPciDevice {
603
602
}
604
603
605
604
/// Register the IoEvent notification for a VirtIO device
606
- pub fn register_notification_ioevent ( & self , vm : & Vm ) -> std :: result :: Result < ( ) , errno:: Error > {
605
+ pub fn register_notification_ioevent ( & self , vm : & Vm ) -> Result < ( ) , errno:: Error > {
607
606
let bar_addr = self . config_bar_addr ( ) ;
608
607
for ( i, queue_evt) in self
609
608
. device
@@ -676,7 +675,7 @@ impl VirtioInterruptMsix {
676
675
}
677
676
678
677
impl VirtioInterrupt for VirtioInterruptMsix {
679
- fn trigger ( & self , int_type : VirtioInterruptType ) -> std :: result :: Result < ( ) , InterruptError > {
678
+ fn trigger ( & self , int_type : VirtioInterruptType ) -> Result < ( ) , InterruptError > {
680
679
let vector = match int_type {
681
680
VirtioInterruptType :: Config => self . config_vector . load ( Ordering :: Acquire ) ,
682
681
VirtioInterruptType :: Queue ( queue_index) => * self
@@ -783,7 +782,7 @@ impl PciDevice for VirtioPciDevice {
783
782
self . configuration . detect_bar_reprogramming ( reg_idx, data)
784
783
}
785
784
786
- fn move_bar ( & mut self , old_base : u64 , new_base : u64 ) -> std :: result :: Result < ( ) , anyhow:: Error > {
785
+ fn move_bar ( & mut self , old_base : u64 , new_base : u64 ) -> Result < ( ) , anyhow:: Error > {
787
786
// We only update our idea of the bar in order to support free_bars() above.
788
787
// The majority of the reallocation is done inside DeviceManager.
789
788
if self . bar_address == old_base {
0 commit comments