mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: qcow: Add backing file path to qcow error context
Extend the BackingFileIo and BackingFileOpen variants of qcow::Error with a path field so that backing file failures report which file was involved. The path is populated from the backing file configuration. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
b1bc376c91
commit
2bcbe25539
@@ -144,8 +144,11 @@ fn shared_backing_from(bf: BackingFile) -> BlockResult<Arc<dyn BackingRead>> {
|
||||
|
||||
let dup_fd = |fd: BorrowedFd<'_>| -> BlockResult<OwnedFd> {
|
||||
fd.try_clone_to_owned().map_err(|e| {
|
||||
BlockError::new(BlockErrorKind::Io, QcowError::BackingFileIo(e))
|
||||
.with_op(ErrorOp::DupBackingFd)
|
||||
BlockError::new(
|
||||
BlockErrorKind::Io,
|
||||
QcowError::BackingFileIo(String::new(), e),
|
||||
)
|
||||
.with_op(ErrorOp::DupBackingFd)
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user