block: qcow_sync: impl Resizable for QcowDiskSync

Add ErrorOp::Resize variant and implement the Resizable trait.
Resize is rejected when a backing file is present.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-03-12 21:20:08 +01:00
committed by Rob Bradford
parent 554562fef2
commit f35bec19e8
2 changed files with 21 additions and 0 deletions

View File

@@ -68,6 +68,8 @@ pub enum ErrorOp {
DetectImageType,
/// Duplicating a backing-file descriptor.
DupBackingFd,
/// Resizing a disk image.
Resize,
}
impl Display for ErrorOp {
@@ -76,6 +78,7 @@ impl Display for ErrorOp {
Self::Open => write!(f, "open"),
Self::DetectImageType => write!(f, "detect_image_type"),
Self::DupBackingFd => write!(f, "dup_backing_fd"),
Self::Resize => write!(f, "resize"),
}
}
}