mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 19:32:20 +00:00
vmm: device_manager: Make serial and ioapic devices migratable
Serial and Ioapic both implement the Migratable trait, hence the DeviceManager can store them in the list of Migratable devices. Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
This commit is contained in:
parent
12b036a824
commit
93d3abfd6e
@ -591,6 +591,7 @@ impl DeviceManager {
|
||||
|
||||
let ioapic =
|
||||
DeviceManager::add_ioapic(&address_manager, Arc::clone(&msi_interrupt_manager))?;
|
||||
let ioapic_migratable = Arc::clone(&ioapic) as Arc<Mutex<dyn Migratable>>;
|
||||
bus_devices.push(Arc::clone(&ioapic) as Arc<Mutex<dyn BusDevice>>);
|
||||
|
||||
// Now we can create the legacy interrupt manager, which needs the freshly
|
||||
@ -651,6 +652,8 @@ impl DeviceManager {
|
||||
device_manager
|
||||
.add_legacy_devices(reset_evt.try_clone().map_err(DeviceManagerError::EventFd)?)?;
|
||||
|
||||
device_manager.add_migratable_device(ioapic_migratable);
|
||||
|
||||
#[cfg(feature = "acpi")]
|
||||
{
|
||||
device_manager.ged_notification_device = device_manager.add_acpi_devices(
|
||||
@ -981,6 +984,8 @@ impl DeviceManager {
|
||||
.insert(serial.clone(), 0x3f8, 0x8)
|
||||
.map_err(DeviceManagerError::BusError)?;
|
||||
|
||||
self.add_migratable_device(Arc::clone(&serial) as Arc<Mutex<dyn Migratable>>);
|
||||
|
||||
Some(serial)
|
||||
} else {
|
||||
None
|
||||
|
Loading…
x
Reference in New Issue
Block a user