mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-05 21:15:45 +00:00
qcow: Fix map_err losing the inner error
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
06396593c9
commit
cf25bd74b0
@ -1221,7 +1221,12 @@ impl QcowFile {
|
|||||||
let refcount = self
|
let refcount = self
|
||||||
.refcounts
|
.refcounts
|
||||||
.get_cluster_refcount(&mut self.raw_file, cluster_addr)
|
.get_cluster_refcount(&mut self.raw_file, cluster_addr)
|
||||||
.map_err(|_| std::io::Error::from_raw_os_error(EINVAL))?;
|
.map_err(|e| {
|
||||||
|
io::Error::new(
|
||||||
|
io::ErrorKind::InvalidData,
|
||||||
|
format!("failed to get cluster refcount: {}", e),
|
||||||
|
)
|
||||||
|
})?;
|
||||||
if refcount == 0 {
|
if refcount == 0 {
|
||||||
return Err(std::io::Error::from_raw_os_error(EINVAL));
|
return Err(std::io::Error::from_raw_os_error(EINVAL));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user