vm-migration: be explicit about commands

Reordering commands or adding commands in-between is breaking the
migration protocol. By using explicit numbers, we can increase the
attention required when touching this code.

On-behalf-of: SAP philipp.schuster@sap.com
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
Philipp Schuster
2026-05-15 19:01:06 +02:00
committed by Rob Bradford
parent ba04c4f318
commit 5899d062bc

View File

@@ -111,19 +111,19 @@ use crate::bitpos_iterator::BitposIteratorExt;
#[derive(Debug, Copy, Clone, Default, PartialEq, Eq)]
pub enum Command {
#[default]
Invalid,
Start,
Config,
State,
Memory,
Invalid = 0,
Start = 1,
Config = 2,
State = 3,
Memory = 4,
/// Finalizes the migration and resumes the VM on the destination.
/// Sent when the source VM was running at migration time.
Complete,
Abandon,
MemoryFd,
Complete = 5,
Abandon = 6,
MemoryFd = 7,
/// Finalizes the migration without resuming the VM on the destination.
/// Sent when the source VM was paused at migration time.
CompletePaused,
CompletePaused = 8,
}
#[repr(C)]