mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-migration: improve debuggability on receiver for failed migrations
We cannot reliably send Request::abandon() on every kind of failure on the sender side, as we might be in the middle of a memory transmission. The receiver would not reliably know what to do with that. So instead, when the receiver cannot read from the socket, we log that the migration sender failed, which is the only likely cause of that failure. On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
committed by
Bo Chen
parent
81022ab087
commit
013981b649
@@ -363,10 +363,19 @@ 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, sender_error: MigratableError) -> Result<Response, MigratableError> {
|
||||
/// Return the response if its status is `Ok`.
|
||||
///
|
||||
/// Otherwise, returns an error and logs that the receiving VMM responded
|
||||
/// with an error, which aborts the migration.
|
||||
pub fn ok_or_fatal_error(
|
||||
self,
|
||||
sender_error: MigratableError,
|
||||
) -> Result<Response, MigratableError> {
|
||||
if self.status != Status::Ok {
|
||||
error!("Receiver reported error: aborting migration");
|
||||
// `sender_error` identifies the sender-side operation that was in
|
||||
// progress when the receiver reported failure; the receiver's
|
||||
// actual error is unknown to the sender VMM.
|
||||
return Err(sender_error);
|
||||
}
|
||||
Ok(self)
|
||||
|
||||
Reference in New Issue
Block a user