vmm: Replace Debug with Display rendering in HTTP error message

Bumping anyhow crate from 1.0.75 to 1.0.79 will cause seccomp
failures through integration tests. Newly added backtrace support
relies on readlink and many other syscalls.

Issue noticed with test_api_http_pause_resume test, where second time
of VM PAUSE or VM RESUME prints error and causes panic.
Noticed that panic message in a thread which is not allowed to write
output triggered the issue.

So implementing Display trait for HttpError and ApiError enums to avoid
adding many syscalls to seccomp filter section.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@intel.com>
This commit is contained in:
Ravi kumar Veeramally
2024-01-22 23:09:40 +02:00
committed by Rob Bradford
parent 9cb996db09
commit 895dc12a74
3 changed files with 62 additions and 3 deletions

View File

@@ -41,8 +41,8 @@ pub struct DBusApi {
api_sender: futures::lock::Mutex<Sender<ApiRequest>>,
}
fn api_error(error: impl std::fmt::Debug) -> fdo::Error {
fdo::Error::Failed(format!("{error:?}"))
fn api_error(error: impl std::fmt::Debug + std::fmt::Display) -> fdo::Error {
fdo::Error::Failed(format!("{error}"))
}
// This method is intended to ensure that the DBusApi thread has enough time to