Can convert QCow2 to raw

This commit is contained in:
Pierre HUBERT 2025-05-29 15:00:14 +02:00
parent 80d81c34bb
commit 452a395525
2 changed files with 13 additions and 1 deletions

View File

@ -192,6 +192,14 @@ impl DiskFileInfo {
cmd
}
// Convert Raw to QCow2 file
(DiskFileFormat::Raw { .. }, DiskFileFormat::QCow2 { .. }) => {
let mut cmd = Command::new(constants::QEMU_IMAGE_PROGRAM);
cmd.arg("convert").arg(&self.file_path).arg(&temp_file);
cmd
}
// Dumb copy of file
(a, b) if a == b => {
let mut cmd = Command::new(constants::COPY_PROGRAM);

View File

@ -38,7 +38,11 @@ export function ConvertDiskImageDialog(p: {
if (value === "QCow2") setFilename(`${p.image.file_name}.qcow2`);
if (value === "CompressedQCow2")
setFilename(`${p.image.file_name}.qcow2.gz`);
if (value === "Raw") setFilename(`${p.image.file_name}.raw`);
if (value === "Raw") {
setFilename(`${p.image.file_name}.raw`);
// Check sparse checkbox by default
setFormat({ format: "Raw", is_sparse: true });
}
if (value === "CompressedRaw") setFilename(`${p.image.file_name}.raw.gz`);
};