@@ -255,7 +255,6 @@ pub enum VirtioPciDeviceError {
255255 /// Error creating MSI configuration: {0}
256256 Msi ( #[ from] InterruptError ) ,
257257}
258- pub type Result < T > = std:: result:: Result < T , VirtioPciDeviceError > ;
259258
260259pub struct VirtioPciDevice {
261260 id : String ,
@@ -370,7 +369,7 @@ impl VirtioPciDevice {
370369 device : Arc < Mutex < dyn VirtioDevice > > ,
371370 msix_vectors : Arc < MsixVectorGroup > ,
372371 pci_device_bdf : u32 ,
373- ) -> Result < Self > {
372+ ) -> Result < Self , VirtioPciDeviceError > {
374373 let num_queues = device. lock ( ) . expect ( "Poisoned lock" ) . queues ( ) . len ( ) ;
375374
376375 let msix_config = Arc :: new ( Mutex :: new ( MsixConfig :: new (
@@ -419,7 +418,7 @@ impl VirtioPciDevice {
419418 vm : & Arc < Vm > ,
420419 device : Arc < Mutex < dyn VirtioDevice > > ,
421420 state : VirtioPciDeviceState ,
422- ) -> Result < Self > {
421+ ) -> Result < Self , VirtioPciDeviceError > {
423422 let msix_config =
424423 MsixConfig :: from_state ( state. msix_state , vm. clone ( ) , state. pci_device_bdf . into ( ) ) ?;
425424 let vectors = msix_config. vectors . clone ( ) ;
@@ -603,7 +602,7 @@ impl VirtioPciDevice {
603602 }
604603
605604 /// 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 > {
607606 let bar_addr = self . config_bar_addr ( ) ;
608607 for ( i, queue_evt) in self
609608 . device
@@ -676,7 +675,7 @@ impl VirtioInterruptMsix {
676675}
677676
678677impl VirtioInterrupt for VirtioInterruptMsix {
679- fn trigger ( & self , int_type : VirtioInterruptType ) -> std :: result :: Result < ( ) , InterruptError > {
678+ fn trigger ( & self , int_type : VirtioInterruptType ) -> Result < ( ) , InterruptError > {
680679 let vector = match int_type {
681680 VirtioInterruptType :: Config => self . config_vector . load ( Ordering :: Acquire ) ,
682681 VirtioInterruptType :: Queue ( queue_index) => * self
@@ -783,7 +782,7 @@ impl PciDevice for VirtioPciDevice {
783782 self . configuration . detect_bar_reprogramming ( reg_idx, data)
784783 }
785784
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 > {
787786 // We only update our idea of the bar in order to support free_bars() above.
788787 // The majority of the reallocation is done inside DeviceManager.
789788 if self . bar_address == old_base {
0 commit comments