Add support of sparse files for QCow2 to sparse conversion
This commit is contained in:
@@ -181,9 +181,14 @@ impl DiskFileInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Convert QCow2 to Raw file
|
// Convert QCow2 to Raw file
|
||||||
(DiskFileFormat::QCow2 { .. }, DiskFileFormat::Raw { .. }) => {
|
(DiskFileFormat::QCow2 { .. }, DiskFileFormat::Raw { is_sparse }) => {
|
||||||
let mut cmd = Command::new(constants::QEMU_IMAGE_PROGRAM);
|
let mut cmd = Command::new(constants::QEMU_IMAGE_PROGRAM);
|
||||||
cmd.arg("convert").arg(&self.file_path).arg(&temp_file);
|
cmd.arg("convert").arg(&self.file_path).arg(&temp_file);
|
||||||
|
|
||||||
|
if !is_sparse {
|
||||||
|
cmd.args(["-S", "0"]);
|
||||||
|
}
|
||||||
|
|
||||||
cmd
|
cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user