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