hypervisor: emulator: Format instructions on error paths

Formatting instructions might be costly, so we only want to do that on
the emulation error paths.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2020-12-01 00:00:53 +01:00
parent 3fa6e17cc4
commit 15f0451c34
4 changed files with 28 additions and 4 deletions

View File

@@ -76,6 +76,9 @@ pub enum EmulationError<T: Debug> {
#[error("Platform emulation error: {0}")]
PlatformEmulationError(PlatformError),
#[error(transparent)]
EmulationError(#[from] anyhow::Error),
}
/// The PlatformEmulator trait emulates a guest platform.