@@ -22,12 +22,12 @@ use crate::arch::{ConfigurationError, configure_system_for_boot, load_kernel};
2222#[ cfg( target_arch = "aarch64" ) ]
2323use crate :: construct_kvm_mpidrs;
2424use crate :: cpu_config:: templates:: { GetCpuTemplate , GetCpuTemplateError , GuestConfigError } ;
25- #[ cfg( target_arch = "aarch64 " ) ]
26- use crate :: device_manager:: AttachLegacyMmioDeviceError ;
25+ #[ cfg( target_arch = "x86_64 " ) ]
26+ use crate :: device_manager;
2727use crate :: device_manager:: pci_mngr:: PciManagerError ;
2828use crate :: device_manager:: {
29- AttachMmioDeviceError , AttachVmgenidError , DeviceManager , DeviceManagerCreateError ,
30- DevicePersistError , DeviceRestoreArgs ,
29+ AttachDeviceError , DeviceManager , DeviceManagerCreateError , DevicePersistError ,
30+ DeviceRestoreArgs ,
3131} ;
3232use crate :: devices:: acpi:: vmgenid:: VmGenIdError ;
3333use crate :: devices:: virtio:: balloon:: Balloon ;
@@ -48,18 +48,15 @@ use crate::vstate::kvm::{Kvm, KvmError};
4848use crate :: vstate:: memory:: GuestRegionMmap ;
4949use crate :: vstate:: vcpu:: VcpuError ;
5050use crate :: vstate:: vm:: { Vm , VmError } ;
51- use crate :: { EventManager , Vmm , VmmError , device_manager } ;
51+ use crate :: { EventManager , Vmm , VmmError } ;
5252
5353/// Errors associated with starting the instance.
5454#[ derive( Debug , thiserror:: Error , displaydoc:: Display ) ]
5555pub enum StartMicrovmError {
5656 /// Unable to attach block device to Vmm: {0}
5757 AttachBlockDevice ( io:: Error ) ,
58- /// Unable to attach the VMGenID device: {0}
59- AttachVmgenidDevice ( #[ from] AttachVmgenidError ) ,
60- #[ cfg( target_arch = "aarch64" ) ]
61- /// Unable to attach legacy MMIO devices: {0}
62- AttachLegacyDevices ( #[ from] AttachLegacyMmioDeviceError ) ,
58+ /// Could not attach device: {0}
59+ AttachDevice ( #[ from] AttachDeviceError ) ,
6360 /// System configuration error: {0}
6461 ConfigureSystem ( #[ from] ConfigurationError ) ,
6562 /// Failed to create device manager: {0}
@@ -104,8 +101,6 @@ pub enum StartMicrovmError {
104101 NetDeviceNotConfigured ,
105102 /// Cannot open the block device backing file: {0}
106103 OpenBlockDevice ( io:: Error ) ,
107- /// Cannot initialize a MMIO Device or add a device to the MMIO Bus or cmdline: {0}
108- RegisterMmioDevice ( #[ from] device_manager:: AttachMmioDeviceError ) ,
109104 /// Cannot restore microvm state: {0}
110105 RestoreMicrovmState ( MicrovmStateError ) ,
111106 /// Cannot set vm resources: {0}
@@ -563,7 +558,7 @@ fn attach_entropy_device(
563558 cmdline : & mut LoaderKernelCmdline ,
564559 entropy_device : & Arc < Mutex < Entropy > > ,
565560 event_manager : & mut EventManager ,
566- ) -> Result < ( ) , AttachMmioDeviceError > {
561+ ) -> Result < ( ) , AttachDeviceError > {
567562 let id = entropy_device
568563 . lock ( )
569564 . expect ( "Poisoned lock" )
@@ -625,7 +620,7 @@ fn attach_unixsock_vsock_device(
625620 cmdline : & mut LoaderKernelCmdline ,
626621 unix_vsock : & Arc < Mutex < Vsock < VsockUnixBackend > > > ,
627622 event_manager : & mut EventManager ,
628- ) -> Result < ( ) , AttachMmioDeviceError > {
623+ ) -> Result < ( ) , AttachDeviceError > {
629624 let id = String :: from ( unix_vsock. lock ( ) . expect ( "Poisoned lock" ) . id ( ) ) ;
630625 event_manager. add_subscriber ( unix_vsock. clone ( ) ) ;
631626 // The device mutex mustn't be locked here otherwise it will deadlock.
@@ -638,7 +633,7 @@ fn attach_balloon_device(
638633 cmdline : & mut LoaderKernelCmdline ,
639634 balloon : & Arc < Mutex < Balloon > > ,
640635 event_manager : & mut EventManager ,
641- ) -> Result < ( ) , AttachMmioDeviceError > {
636+ ) -> Result < ( ) , AttachDeviceError > {
642637 let id = String :: from ( balloon. lock ( ) . expect ( "Poisoned lock" ) . id ( ) ) ;
643638 event_manager. add_subscriber ( balloon. clone ( ) ) ;
644639 // The device mutex mustn't be locked here otherwise it will deadlock.
0 commit comments