From 5899d062bc6b25d5f22b76c0c4edae63db1dda21 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Fri, 15 May 2026 19:01:06 +0200 Subject: [PATCH] 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 --- vm-migration/src/protocol.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vm-migration/src/protocol.rs b/vm-migration/src/protocol.rs index 997ac8d81..5fffbada8 100644 --- a/vm-migration/src/protocol.rs +++ b/vm-migration/src/protocol.rs @@ -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)]