From 65774e8a789214c4cfd89c5d0da745c9b6760f30 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Thu, 27 Feb 2020 11:40:05 +0100 Subject: [PATCH] vmm: Implement BusDevice for DeviceManager In anticipation of inserting the DeviceManager on the IO/MMIO buses, the DeviceManager must implement the BusDevice trait. Signed-off-by: Sebastien Boeuf --- vm-device/src/lib.rs | 2 +- vmm/src/device_manager.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vm-device/src/lib.rs b/vm-device/src/lib.rs index bd5b01e57..991131785 100644 --- a/vm-device/src/lib.rs +++ b/vm-device/src/lib.rs @@ -49,7 +49,7 @@ pub trait Snapshotable {} /// All migratable components are paused before being snapshotted, and then /// eventually resumed. Thus any Migratable component must be both Pausable /// and Snapshotable. -pub trait Migratable: Pausable + Snapshotable {} +pub trait Migratable: Send + Pausable + Snapshotable {} fn get_region_host_address_range( region: &GuestRegionMmap, diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index 03f81b746..79bef4076 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -22,7 +22,7 @@ use acpi_tables::{aml, aml::Aml}; #[cfg(feature = "acpi")] use arch::layout; use arch::layout::{APIC_START, IOAPIC_SIZE, IOAPIC_START}; -use devices::{ioapic, HotPlugNotificationFlags}; +use devices::{ioapic, BusDevice, HotPlugNotificationFlags}; use kvm_ioctls::*; use libc::O_TMPFILE; use libc::TIOCGWINSZ; @@ -1841,6 +1841,8 @@ impl Pausable for DeviceManager { impl Snapshotable for DeviceManager {} impl Migratable for DeviceManager {} +impl BusDevice for DeviceManager {} + impl Drop for DeviceManager { fn drop(&mut self) { for (device, _) in self.virtio_devices.drain(..) {