Prevent shrinking attempts
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-06-09 17:48:17 +02:00
parent 940302a825
commit 63126c75fa

View File

@ -406,6 +406,10 @@ impl DiskFileInfo {
/// Resize disk
pub fn resize(&self, new_size: FileSize) -> anyhow::Result<()> {
if new_size <= self.virtual_size().unwrap_or(new_size) {
anyhow::bail!("Shrinking disk image file is not supported!");
}
let mut cmd = Command::new(constants::PROGRAM_QEMU_IMAGE);
cmd.arg("resize")
.arg("-f")