vmm: Snapshot and restore DeviceManager state

The DeviceManager itself must be snapshotted in order to store the
information regarding the devices associated with it, which effectively
means we need to store the device tree.

The mechanics to snapshot and restore the DeviceManagerState are added
to the existing snapshot() and restore() implementations.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2020-04-28 12:08:51 +02:00
parent 5b408eec66
commit 52c80cfcf5
2 changed files with 57 additions and 5 deletions

View File

@@ -1,3 +1,5 @@
#[macro_use]
extern crate serde_derive;
extern crate vm_memory;
pub mod interrupt;
@@ -8,7 +10,7 @@ use vm_memory::{
};
/// Type of Message Singaled Interrupt
#[derive(Copy, Clone, PartialEq)]
#[derive(Copy, Clone, PartialEq, Serialize, Deserialize)]
pub enum MsiIrqType {
/// PCI MSI IRQ numbers.
PciMsi,
@@ -20,7 +22,7 @@ pub enum MsiIrqType {
/// Enumeration for device resources.
#[allow(missing_docs)]
#[derive(Clone)]
#[derive(Clone, Serialize, Deserialize)]
pub enum Resource {
/// IO Port address range.
PioAddressRange { base: u16, size: u16 },