diff --git a/qcow/src/qcow.rs b/qcow/src/qcow.rs index ad771c56b9..cba4e0613c 100644 --- a/qcow/src/qcow.rs +++ b/qcow/src/qcow.rs @@ -24,7 +24,7 @@ use std::io::{self, Read, Seek, SeekFrom, Write}; use std::mem::size_of; use std::os::unix::io::{AsRawFd, RawFd}; -use sys_util::{FileSync, PunchHole, SeekHole, WriteZeroes}; +use sys_util::{FileSetLen, FileSync, PunchHole, SeekHole, WriteZeroes}; #[derive(Debug)] pub enum Error { @@ -1382,6 +1382,15 @@ impl FileSync for QcowFile { } } +impl FileSetLen for QcowFile { + fn set_len(&self, _len: u64) -> std::io::Result<()> { + Err(std::io::Error::new( + std::io::ErrorKind::Other, + "set_len() not supported for QcowFile", + )) + } +} + impl PunchHole for QcowFile { fn punch_hole(&mut self, offset: u64, length: u64) -> std::io::Result<()> { let mut remaining = length;