From f184a0f0f3b909592228c19ab81196793310be7d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 4 Mar 2026 22:26:12 +0100 Subject: [PATCH] block: Add error module skeleton Introduce error.rs as the home for a unified error hierarchy that will replace the per format error types at the public crate boundary. This commit is intentionally empty beyond the copyright header and module declaration in lib.rs. Signed-off-by: Anatol Belski --- block/src/error.rs | 17 +++++++++++++++++ block/src/lib.rs | 1 + 2 files changed, 18 insertions(+) create mode 100644 block/src/error.rs diff --git a/block/src/error.rs b/block/src/error.rs new file mode 100644 index 000000000..a8dc2c1ad --- /dev/null +++ b/block/src/error.rs @@ -0,0 +1,17 @@ +// Copyright 2025 The Cloud Hypervisor Authors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +//! Unified error handling for the block crate. +//! +//! # Architecture +//! +//! ```text +//! BlockError -- single public error type +//! |-- BlockErrorKind -- small, stable, matchable classification +//! |-- ErrorContext -- optional diagnostic metadata (path, offset, op) +//! +-- source -- format-specific error (boxed) +//! |-- QcowError +//! |-- VhdError / RawError / ... +//! +-- io::Error / etc. +//! ``` diff --git a/block/src/lib.rs b/block/src/lib.rs index f8d56cf10..1b739beaf 100644 --- a/block/src/lib.rs +++ b/block/src/lib.rs @@ -9,6 +9,7 @@ // SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause pub mod async_io; +pub mod error; pub mod fcntl; pub mod fixed_vhd; #[cfg(feature = "io_uring")]