mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Provide a restoring state to the DeviceManager
In anticipation for creating vhost-user devices in a different way when being restored compared to a fresh start, this commit introduces a new boolean created by the Vm depending on the use case, and passed down to the DeviceManager. In the future, the DeviceManager will use this flag to assess how vhost-user devices should be created. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -941,6 +941,9 @@ pub struct DeviceManager {
|
||||
|
||||
// Flag to force setting the iommu on virtio devices
|
||||
force_iommu: bool,
|
||||
|
||||
// Helps identify if the VM is currently being restored
|
||||
restoring: bool,
|
||||
}
|
||||
|
||||
impl DeviceManager {
|
||||
@@ -955,6 +958,7 @@ impl DeviceManager {
|
||||
#[cfg(feature = "acpi")] numa_nodes: NumaNodes,
|
||||
activate_evt: &EventFd,
|
||||
force_iommu: bool,
|
||||
restoring: bool,
|
||||
) -> DeviceManagerResult<Arc<Mutex<Self>>> {
|
||||
let device_tree = Arc::new(Mutex::new(DeviceTree::new()));
|
||||
|
||||
@@ -1028,6 +1032,7 @@ impl DeviceManager {
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
gpio_device: None,
|
||||
force_iommu,
|
||||
restoring,
|
||||
};
|
||||
|
||||
let device_manager = Arc::new(Mutex::new(device_manager));
|
||||
@@ -3637,6 +3642,10 @@ impl DeviceManager {
|
||||
}
|
||||
}
|
||||
|
||||
// The devices have been fully restored, we can now update the
|
||||
// restoring state of the DeviceManager.
|
||||
self.restoring = false;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user