Add qcow2.xz file format support
This commit is contained in:
		@@ -4,8 +4,8 @@ import { VMFileDisk, VMInfo } from "./VMApi";
 | 
			
		||||
export type DiskImageFormat =
 | 
			
		||||
  | { format: "Raw"; is_sparse: boolean }
 | 
			
		||||
  | { format: "QCow2"; virtual_size?: number }
 | 
			
		||||
  | { format: "CompressedQCow2" }
 | 
			
		||||
  | { format: "CompressedRaw" };
 | 
			
		||||
  | { format: "GzCompressedQCow2" }
 | 
			
		||||
  | { format: "GzCompressedRaw" };
 | 
			
		||||
 | 
			
		||||
export type DiskImage = {
 | 
			
		||||
  file_size: number;
 | 
			
		||||
 
 | 
			
		||||
@@ -42,13 +42,15 @@ export function ConvertDiskImageDialog(
 | 
			
		||||
    setFormat({ format: value ?? ("QCow2" as any) });
 | 
			
		||||
 | 
			
		||||
    if (value === "QCow2") setFilename(`${origFilename}.qcow2`);
 | 
			
		||||
    if (value === "CompressedQCow2") setFilename(`${origFilename}.qcow2.gz`);
 | 
			
		||||
    if (value === "GzCompressedQCow2") setFilename(`${origFilename}.qcow2.gz`);
 | 
			
		||||
    if (value === "XzCompressedQCow2") setFilename(`${origFilename}.qcow2.xz`);
 | 
			
		||||
    if (value === "Raw") {
 | 
			
		||||
      setFilename(`${origFilename}.raw`);
 | 
			
		||||
      // Check sparse checkbox by default
 | 
			
		||||
      setFormat({ format: "Raw", is_sparse: true });
 | 
			
		||||
    }
 | 
			
		||||
    if (value === "CompressedRaw") setFilename(`${origFilename}.raw.gz`);
 | 
			
		||||
    if (value === "GzCompressedRaw") setFilename(`${origFilename}.raw.gz`);
 | 
			
		||||
    if (value === "XzCompressedRaw") setFilename(`${origFilename}.raw.xz`);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  const handleSubmit = async () => {
 | 
			
		||||
@@ -104,8 +106,10 @@ export function ConvertDiskImageDialog(
 | 
			
		||||
          options={[
 | 
			
		||||
            { value: "QCow2" },
 | 
			
		||||
            { value: "Raw" },
 | 
			
		||||
            { value: "CompressedRaw" },
 | 
			
		||||
            { value: "CompressedQCow2" },
 | 
			
		||||
            { value: "GzCompressedRaw" },
 | 
			
		||||
            { value: "XzCompressedRaw" },
 | 
			
		||||
            { value: "GzCompressedQCow2" },
 | 
			
		||||
            { value: "XzCompressedQCow2" },
 | 
			
		||||
          ]}
 | 
			
		||||
        />
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user