vmm, vm-migration: validate protocol version at start

Validate the sender's migration protocol version when
handling the initial Start request.

Read the version from the Start command header, accept only
the supported version window n-1..=n, and reject unsupported
versions with Error. A rejected Start moves the receiver to
the aborted state.

This keeps compatibility one-way, from older protocol
versions to newer ones, and leaves later version-based
branching on the receiver side.

Log the protocol version on both sender and receiver to make
the active migration path visible.

On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
This commit is contained in:
Leander Kohler
2026-03-18 13:48:42 +01:00
committed by Rob Bradford
parent b27faaaa45
commit 51bd9d24f3
2 changed files with 42 additions and 2 deletions

View File

@@ -937,7 +937,11 @@ impl Vmm {
let state_name = state.variant_name();
match state {
Established => match req.command() {
Command::Start => Ok(Started),
Command::Start => {
let migration_protocol_version = req.sender_protocol_version()?;
debug!("Using migration protocol {migration_protocol_version}");
Ok(Started)
}
c => invalid_command(state_name, c),
},
Started => match req.command() {
@@ -1420,6 +1424,7 @@ impl Vmm {
Request::start(),
MigratableError::MigrateSend(anyhow!("Error starting migration")),
)?;
debug!("Using migration protocol {CURRENT_PROTOCOL_VERSION}");
// Send config
let vm_config = vm.get_config();