mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-07 04:07:21 +00:00
vmm: unify TranslateVirtualAddress error for both x86_64 and aarch64
Using anyhow::Error should cover both architectures. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
88bbf7989a
commit
3e6b0a5eab
@ -155,11 +155,7 @@ pub enum Error {
|
||||
#[error("Error during CPU debug: {0}")]
|
||||
CpuDebug(#[source] hypervisor::HypervisorCpuError),
|
||||
|
||||
#[cfg(all(target_arch = "x86_64", feature = "gdb"))]
|
||||
#[error("Error translating virtual address: {0}")]
|
||||
TranslateVirtualAddress(#[source] hypervisor::HypervisorCpuError),
|
||||
|
||||
#[cfg(all(target_arch = "aarch64", feature = "gdb"))]
|
||||
#[cfg(feature = "gdb")]
|
||||
#[error("Error translating virtual address: {0}")]
|
||||
TranslateVirtualAddress(#[source] anyhow::Error),
|
||||
|
||||
@ -1505,7 +1501,7 @@ impl CpuManager {
|
||||
.unwrap()
|
||||
.vcpu
|
||||
.translate_gva(gva, /* flags: unused */ 0)
|
||||
.map_err(Error::TranslateVirtualAddress)?;
|
||||
.map_err(|e| Error::TranslateVirtualAddress(e.into()))?;
|
||||
Ok(gpa)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user