2024-01-30 18:09:26 -08:00
|
|
|
use std::io;
|
|
|
|
|
2024-12-14 17:59:07 -05:00
|
|
|
use tokio::task::JoinError;
|
|
|
|
|
2024-01-30 18:09:26 -08:00
|
|
|
#[derive(thiserror::Error, Debug)]
|
|
|
|
pub enum Error {
|
2024-03-10 00:22:24 +00:00
|
|
|
#[error("version of xen is not supported")]
|
|
|
|
XenVersionUnsupported,
|
|
|
|
#[error("kernel error: {0}")]
|
2024-01-30 18:09:26 -08:00
|
|
|
Kernel(#[from] nix::errno::Errno),
|
2024-03-10 00:22:24 +00:00
|
|
|
#[error("io issue encountered: {0}")]
|
2024-01-30 18:09:26 -08:00
|
|
|
Io(#[from] io::Error),
|
2024-04-02 00:56:18 +00:00
|
|
|
#[error("failed to acquire semaphore: {0}")]
|
|
|
|
AcquireSemaphoreFailed(#[from] tokio::sync::AcquireError),
|
2024-01-30 18:09:26 -08:00
|
|
|
#[error("populate physmap failed")]
|
|
|
|
PopulatePhysmapFailed,
|
2024-04-02 00:56:18 +00:00
|
|
|
#[error("mmap batch failed: {0}")]
|
|
|
|
MmapBatchFailed(nix::errno::Errno),
|
2024-06-28 15:13:57 -07:00
|
|
|
#[error("specified value is too long")]
|
|
|
|
ValueTooLong,
|
2024-12-14 17:59:07 -05:00
|
|
|
#[error("failed to join async task: {0}")]
|
|
|
|
JoinError(JoinError),
|
2024-01-30 18:09:26 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|