@@ -22,12 +22,12 @@ use crate::arch::{ConfigurationError, configure_system_for_boot, load_kernel};
22
22
#[ cfg( target_arch = "aarch64" ) ]
23
23
use crate :: construct_kvm_mpidrs;
24
24
use 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;
27
27
use crate :: device_manager:: pci_mngr:: PciManagerError ;
28
28
use crate :: device_manager:: {
29
- AttachMmioDeviceError , AttachVmgenidError , DeviceManager , DeviceManagerCreateError ,
30
- DevicePersistError , DeviceRestoreArgs ,
29
+ AttachDeviceError , DeviceManager , DeviceManagerCreateError , DevicePersistError ,
30
+ DeviceRestoreArgs ,
31
31
} ;
32
32
use crate :: devices:: acpi:: vmgenid:: VmGenIdError ;
33
33
use crate :: devices:: virtio:: balloon:: Balloon ;
@@ -48,18 +48,15 @@ use crate::vstate::kvm::{Kvm, KvmError};
48
48
use crate :: vstate:: memory:: GuestRegionMmap ;
49
49
use crate :: vstate:: vcpu:: VcpuError ;
50
50
use crate :: vstate:: vm:: { Vm , VmError } ;
51
- use crate :: { EventManager , Vmm , VmmError , device_manager } ;
51
+ use crate :: { EventManager , Vmm , VmmError } ;
52
52
53
53
/// Errors associated with starting the instance.
54
54
#[ derive( Debug , thiserror:: Error , displaydoc:: Display ) ]
55
55
pub enum StartMicrovmError {
56
56
/// Unable to attach block device to Vmm: {0}
57
57
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 ) ,
63
60
/// System configuration error: {0}
64
61
ConfigureSystem ( #[ from] ConfigurationError ) ,
65
62
/// Failed to create device manager: {0}
@@ -104,8 +101,6 @@ pub enum StartMicrovmError {
104
101
NetDeviceNotConfigured ,
105
102
/// Cannot open the block device backing file: {0}
106
103
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 ) ,
109
104
/// Cannot restore microvm state: {0}
110
105
RestoreMicrovmState ( MicrovmStateError ) ,
111
106
/// Cannot set vm resources: {0}
@@ -563,7 +558,7 @@ fn attach_entropy_device(
563
558
cmdline : & mut LoaderKernelCmdline ,
564
559
entropy_device : & Arc < Mutex < Entropy > > ,
565
560
event_manager : & mut EventManager ,
566
- ) -> Result < ( ) , AttachMmioDeviceError > {
561
+ ) -> Result < ( ) , AttachDeviceError > {
567
562
let id = entropy_device
568
563
. lock ( )
569
564
. expect ( "Poisoned lock" )
@@ -625,7 +620,7 @@ fn attach_unixsock_vsock_device(
625
620
cmdline : & mut LoaderKernelCmdline ,
626
621
unix_vsock : & Arc < Mutex < Vsock < VsockUnixBackend > > > ,
627
622
event_manager : & mut EventManager ,
628
- ) -> Result < ( ) , AttachMmioDeviceError > {
623
+ ) -> Result < ( ) , AttachDeviceError > {
629
624
let id = String :: from ( unix_vsock. lock ( ) . expect ( "Poisoned lock" ) . id ( ) ) ;
630
625
event_manager. add_subscriber ( unix_vsock. clone ( ) ) ;
631
626
// The device mutex mustn't be locked here otherwise it will deadlock.
@@ -638,7 +633,7 @@ fn attach_balloon_device(
638
633
cmdline : & mut LoaderKernelCmdline ,
639
634
balloon : & Arc < Mutex < Balloon > > ,
640
635
event_manager : & mut EventManager ,
641
- ) -> Result < ( ) , AttachMmioDeviceError > {
636
+ ) -> Result < ( ) , AttachDeviceError > {
642
637
let id = String :: from ( balloon. lock ( ) . expect ( "Poisoned lock" ) . id ( ) ) ;
643
638
event_manager. add_subscriber ( balloon. clone ( ) ) ;
644
639
// The device mutex mustn't be locked here otherwise it will deadlock.
0 commit comments