vm-migration: stop sending abandon after error response

When the receiver of a live migration encounters an error, it sends an
error response. The sender of the migration would then send an abandon
request and wait for a response. This abandon request is not necessary,
because the receiver already abandoned the migration due to the error it
encountered.

From now on this function will not send an abandon request to the
receiver anymore, thus it was renamed to "ok_or_error".

Also, this case was always broken, because after sending the error
response, the receiver just exits without waiting for the additional
abandon request.

On-behalf-of: SAP sebastian.eydam@sap.com
Signed-off-by: Sebastian Eydam <sebastian.eydam@cyberus-technology.de>
This commit is contained in:
Sebastian Eydam
2026-03-25 15:12:33 +01:00
committed by Bo Chen
parent f35c9842be
commit 969d2f855d
3 changed files with 6 additions and 17 deletions

View File

@@ -1115,9 +1115,7 @@ pub(crate) fn expect_ok_response(
socket: &mut SocketStream,
error: MigratableError,
) -> Result<(), MigratableError> {
Response::read_from(socket)?
.ok_or_abandon(socket, error)
.map(|_| ())
Response::read_from(socket)?.ok_or_error(error).map(|_| ())
}
/// Send a request and validate that the peer responds with OK.

View File

@@ -3026,10 +3026,9 @@ impl Vm {
.context("Error sending memory fd")
.map_err(MigratableError::MigrateSend)?;
Response::read_from(socket)?.ok_or_abandon(
socket,
MigratableError::MigrateSend(anyhow!("Error during memory fd migration")),
)?;
Response::read_from(socket)?.ok_or_error(MigratableError::MigrateSend(anyhow!(
"Error during memory fd migration"
)))?;
}
Ok(())