mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
@@ -362,17 +362,9 @@ impl Response {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn ok_or_abandon<T>(
|
||||
self,
|
||||
fd: &mut T,
|
||||
error: MigratableError,
|
||||
) -> Result<Response, MigratableError>
|
||||
where
|
||||
T: Read + Write,
|
||||
{
|
||||
/// 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<Response, MigratableError> {
|
||||
if self.status != Status::Ok {
|
||||
Request::abandon().write_to(fd)?;
|
||||
Response::read_from(fd)?;
|
||||
return Err(error);
|
||||
}
|
||||
Ok(self)
|
||||
|
||||
Reference in New Issue
Block a user