MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / resize

Method resize

block/src/qcow_disk.rs:128–142  ·  view source on GitHub ↗
(&mut self, size: u64)

Source from the content-addressed store, hash-verified

126
127impl disk_file::Resizable for QcowDisk {
128 fn resize(&mut self, size: u64) -> BlockResult<()> {
129 if self.backing_file.is_some() {
130 return Err(BlockError::new(
131 BlockErrorKind::UnsupportedFeature,
132 DiskFileError::ResizeError(io::Error::other(
133 "resize not supported with backing files",
134 )),
135 )
136 .with_op(ErrorOp::Resize));
137 }
138 self.metadata.resize(size).map_err(|e| {
139 BlockError::new(BlockErrorKind::Io, DiskFileError::ResizeError(e))
140 .with_op(ErrorOp::Resize)
141 })
142 }
143}
144
145impl disk_file::DiskFile for QcowDisk {}

Callers

nothing calls this directly

Calls 2

newFunction · 0.85
with_opMethod · 0.80

Tested by

no test coverage detected