From 81022ab087a868e00afa74fddb1964a66875b7a0 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Mon, 29 Jun 2026 11:18:40 +0200 Subject: [PATCH] vm-migration: improve logging to make clear if receiver caused failure This improves the observability whether a migration failed because of the sender or because of some error on the receiving side. Using a simple log message is simpler than introducing a new error enum to differentiate between SendError and RemoteError. On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster --- vm-migration/src/protocol.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vm-migration/src/protocol.rs b/vm-migration/src/protocol.rs index fac7c5cc5..810f37d49 100644 --- a/vm-migration/src/protocol.rs +++ b/vm-migration/src/protocol.rs @@ -91,6 +91,7 @@ use std::ops::RangeInclusive; use anyhow::anyhow; use itertools::Itertools; +use log::error; use serde::{Deserialize, Serialize}; use zerocopy::{FromBytes, Immutable, IntoBytes, TryFromBytes}; @@ -363,9 +364,10 @@ impl Response { } /// Return the response if its status is `Ok`; return the caller-provided error for any other status. - pub fn ok_or_error(self, error: MigratableError) -> Result { + pub fn ok_or_error(self, sender_error: MigratableError) -> Result { if self.status != Status::Ok { - return Err(error); + error!("Receiver reported error: aborting migration"); + return Err(sender_error); } Ok(self) }