mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 21:55:20 +00:00
vmm: cpu: Store the vCPU snapshots in ascending order
The snapshots are stored in a BTree which is ordered however as the ids are strings lexical ordering places "11" ahead of "2". So encode the vCPU id with zero padding so it is lexically sorted. This fixes issues with CPU restore on aarch64. See: #4239 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
6ac8dc8745
commit
65ec6631fb
@ -387,7 +387,7 @@ impl Snapshottable for Vcpu {
|
||||
.state()
|
||||
.map_err(|e| MigratableError::Pause(anyhow!("Could not get vCPU state {:?}", e)))?;
|
||||
|
||||
let mut vcpu_snapshot = Snapshot::new(&format!("{}", self.id));
|
||||
let mut vcpu_snapshot = Snapshot::new(&format!("{:03}", self.id));
|
||||
vcpu_snapshot.add_data_section(SnapshotDataSection::new_from_state(
|
||||
VCPU_SNAPSHOT_ID,
|
||||
&saved_state,
|
||||
|
Loading…
Reference in New Issue
Block a user