@@ -28,7 +28,7 @@ use crate::cpu_config::templates::{
2828use crate :: device_manager:: acpi:: ACPIDeviceManager ;
2929#[ cfg( target_arch = "x86_64" ) ]
3030use crate :: device_manager:: legacy:: PortIODeviceManager ;
31- use crate :: device_manager:: mmio:: MMIODeviceManager ;
31+ use crate :: device_manager:: mmio:: { MMIODeviceManager , MmioError } ;
3232use crate :: device_manager:: persist:: {
3333 ACPIDeviceManagerConstructorArgs , ACPIDeviceManagerRestoreError , MMIODevManagerConstructorArgs ,
3434} ;
@@ -590,9 +590,7 @@ fn attach_virtio_device<T: 'static + VirtioDevice + MutEventSubscriber + Debug>(
590590 device : Arc < Mutex < T > > ,
591591 cmdline : & mut LoaderKernelCmdline ,
592592 is_vhost_user : bool ,
593- ) -> Result < ( ) , StartMicrovmError > {
594- use self :: StartMicrovmError :: * ;
595-
593+ ) -> Result < ( ) , MmioError > {
596594 event_manager. add_subscriber ( device. clone ( ) ) ;
597595
598596 // The device mutex mustn't be locked here otherwise it will deadlock.
@@ -605,21 +603,17 @@ fn attach_virtio_device<T: 'static + VirtioDevice + MutEventSubscriber + Debug>(
605603 device,
606604 cmdline,
607605 )
608- . map_err ( RegisterMmioDevice )
609606 . map ( |_| ( ) )
610607}
611608
612609pub ( crate ) fn attach_boot_timer_device (
613610 vmm : & mut Vmm ,
614611 request_ts : TimestampUs ,
615- ) -> Result < ( ) , StartMicrovmError > {
616- use self :: StartMicrovmError :: * ;
617-
612+ ) -> Result < ( ) , MmioError > {
618613 let boot_timer = crate :: devices:: pseudo:: BootTimer :: new ( request_ts) ;
619614
620615 vmm. mmio_device_manager
621- . register_mmio_boot_timer ( & mut vmm. resource_allocator , boot_timer)
622- . map_err ( RegisterMmioDevice ) ?;
616+ . register_mmio_boot_timer ( & mut vmm. resource_allocator , boot_timer) ?;
623617
624618 Ok ( ( ) )
625619}
@@ -640,7 +634,7 @@ fn attach_entropy_device(
640634 cmdline : & mut LoaderKernelCmdline ,
641635 entropy_device : & Arc < Mutex < Entropy > > ,
642636 event_manager : & mut EventManager ,
643- ) -> Result < ( ) , StartMicrovmError > {
637+ ) -> Result < ( ) , MmioError > {
644638 let id = entropy_device
645639 . lock ( )
646640 . expect ( "Poisoned lock" )
@@ -710,7 +704,7 @@ fn attach_unixsock_vsock_device(
710704 cmdline : & mut LoaderKernelCmdline ,
711705 unix_vsock : & Arc < Mutex < Vsock < VsockUnixBackend > > > ,
712706 event_manager : & mut EventManager ,
713- ) -> Result < ( ) , StartMicrovmError > {
707+ ) -> Result < ( ) , MmioError > {
714708 let id = String :: from ( unix_vsock. lock ( ) . expect ( "Poisoned lock" ) . id ( ) ) ;
715709 // The device mutex mustn't be locked here otherwise it will deadlock.
716710 attach_virtio_device ( event_manager, vmm, id, unix_vsock. clone ( ) , cmdline, false )
@@ -721,7 +715,7 @@ fn attach_balloon_device(
721715 cmdline : & mut LoaderKernelCmdline ,
722716 balloon : & Arc < Mutex < Balloon > > ,
723717 event_manager : & mut EventManager ,
724- ) -> Result < ( ) , StartMicrovmError > {
718+ ) -> Result < ( ) , MmioError > {
725719 let id = String :: from ( balloon. lock ( ) . expect ( "Poisoned lock" ) . id ( ) ) ;
726720 // The device mutex mustn't be locked here otherwise it will deadlock.
727721 attach_virtio_device ( event_manager, vmm, id, balloon. clone ( ) , cmdline, false )
0 commit comments