vmm: Store and restore virtio-mmio resources

Based on the device tree, retrieve the resources associated with a
virtio-mmio device to restore it at the right location in guest address
space. Also, the IRQ number is correctly restored.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2020-04-29 15:18:04 +02:00
parent 9cb1e1cc6b
commit 987f82152e
2 changed files with 100 additions and 27 deletions

View File

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