mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-23 16:31:16 +00:00
vmm: Provide an owned Snapshot rather than a reference
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
a4160c1fef
commit
2e01bf7f74
@ -1264,7 +1264,7 @@ impl Vmm {
|
|||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
Some(&snapshot),
|
Some(snapshot),
|
||||||
)
|
)
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
MigratableError::MigrateReceive(anyhow!("Error creating VM from snapshot: {:?}", e))
|
MigratableError::MigrateReceive(anyhow!("Error creating VM from snapshot: {:?}", e))
|
||||||
|
@ -479,7 +479,7 @@ impl Vm {
|
|||||||
serial_pty: Option<PtyPair>,
|
serial_pty: Option<PtyPair>,
|
||||||
console_pty: Option<PtyPair>,
|
console_pty: Option<PtyPair>,
|
||||||
console_resize_pipe: Option<File>,
|
console_resize_pipe: Option<File>,
|
||||||
snapshot: Option<&Snapshot>,
|
snapshot: Option<Snapshot>,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
trace_scoped!("Vm::new_from_memory_manager");
|
trace_scoped!("Vm::new_from_memory_manager");
|
||||||
|
|
||||||
@ -546,7 +546,7 @@ impl Vm {
|
|||||||
cpu_manager
|
cpu_manager
|
||||||
.lock()
|
.lock()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.create_boot_vcpus(snapshot_from_id(snapshot, CPU_MANAGER_SNAPSHOT_ID))
|
.create_boot_vcpus(snapshot_from_id(snapshot.as_ref(), CPU_MANAGER_SNAPSHOT_ID))
|
||||||
.map_err(Error::CpuManager)?;
|
.map_err(Error::CpuManager)?;
|
||||||
|
|
||||||
#[cfg(feature = "tdx")]
|
#[cfg(feature = "tdx")]
|
||||||
@ -571,7 +571,7 @@ impl Vm {
|
|||||||
force_iommu,
|
force_iommu,
|
||||||
boot_id_list,
|
boot_id_list,
|
||||||
timestamp,
|
timestamp,
|
||||||
snapshot_from_id(snapshot, DEVICE_MANAGER_SNAPSHOT_ID),
|
snapshot_from_id(snapshot.as_ref(), DEVICE_MANAGER_SNAPSHOT_ID),
|
||||||
dynamic,
|
dynamic,
|
||||||
)
|
)
|
||||||
.map_err(Error::DeviceManager)?;
|
.map_err(Error::DeviceManager)?;
|
||||||
@ -799,7 +799,7 @@ impl Vm {
|
|||||||
serial_pty,
|
serial_pty,
|
||||||
console_pty,
|
console_pty,
|
||||||
console_resize_pipe,
|
console_resize_pipe,
|
||||||
snapshot.as_ref(),
|
snapshot,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user