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:
Sebastien Boeuf
2021-08-06 15:39:09 +02:00
committed by Bo Chen
parent 2c54c30435
commit 06729bb3ba
2 changed files with 14 additions and 0 deletions
+5
View File
@@ -541,6 +541,7 @@ impl Vm {
hypervisor::ClockData,
>,
activate_evt: EventFd,
restoring: bool,
) -> Result<Self> {
config
.lock()
@@ -571,6 +572,7 @@ impl Vm {
numa_nodes.clone(),
&activate_evt,
force_iommu,
restoring,
)
.map_err(Error::DeviceManager)?;
@@ -796,6 +798,7 @@ impl Vm {
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
None,
activate_evt,
false,
)?;
// The device manager must create the devices from here as it is part
@@ -865,6 +868,7 @@ impl Vm {
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
vm_snapshot.clock,
activate_evt,
true,
)
}
@@ -907,6 +911,7 @@ impl Vm {
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
None,
activate_evt,
true,
)
}