From 98dac352b8d6b8bb19fce65db0877e02c12d9bb6 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Mon, 11 May 2020 17:21:25 +0200 Subject: [PATCH] vmm: Add optional PCI b/d/f to each DeviceNode We need a way to store the information about where a PCI device was placed on the PCI bus before the VM was snapshotted. The way to do this is by adding an extra field to the DeviceNode structure. Signed-off-by: Sebastien Boeuf --- vmm/src/device_tree.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vmm/src/device_tree.rs b/vmm/src/device_tree.rs index 187d1f192..c062db683 100644 --- a/vmm/src/device_tree.rs +++ b/vmm/src/device_tree.rs @@ -15,6 +15,8 @@ pub struct DeviceNode { pub children: Vec, #[serde(skip)] pub migratable: Option>>, + #[cfg(feature = "pci_support")] + pub pci_bdf: Option, } impl DeviceNode { @@ -25,6 +27,8 @@ impl DeviceNode { parent: None, children: Vec::new(), migratable, + #[cfg(feature = "pci_support")] + pci_bdf: None, } } }