Can convert QCow2 to raw
This commit is contained in:
		@@ -192,6 +192,14 @@ impl DiskFileInfo {
 | 
				
			|||||||
                cmd
 | 
					                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
 | 
					            // Dumb copy of file
 | 
				
			||||||
            (a, b) if a == b => {
 | 
					            (a, b) if a == b => {
 | 
				
			||||||
                let mut cmd = Command::new(constants::COPY_PROGRAM);
 | 
					                let mut cmd = Command::new(constants::COPY_PROGRAM);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,7 +38,11 @@ export function ConvertDiskImageDialog(p: {
 | 
				
			|||||||
    if (value === "QCow2") setFilename(`${p.image.file_name}.qcow2`);
 | 
					    if (value === "QCow2") setFilename(`${p.image.file_name}.qcow2`);
 | 
				
			||||||
    if (value === "CompressedQCow2")
 | 
					    if (value === "CompressedQCow2")
 | 
				
			||||||
      setFilename(`${p.image.file_name}.qcow2.gz`);
 | 
					      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`);
 | 
					    if (value === "CompressedRaw") setFilename(`${p.image.file_name}.raw.gz`);
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user