mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 05:03:05 +00:00
qcow: add no-op set_len() for QcowFile
We won't support resizing a QcowFile for now, since it would require resizing refcount and L1 tables. BUG=chromium:858815 TEST=build_test Change-Id: Ia108e07be8b06b6fbe81838831a8ecbffdfb341c Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1394149 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Dylan Reid <dgreid@chromium.org>
This commit is contained in:
parent
6d47e1b005
commit
e57d906dbb
1 changed files with 10 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue