// /*************************************************************************** // The Disc Image Chef // ---------------------------------------------------------------------------- // // Filename : Structs.cs // Author(s) : Natalia Portillo // // Component : Disk image plugins. // // --[ Description ] ---------------------------------------------------------- // // Contains structures for QEMU Copy-On-Write v2 disk images. // // --[ License ] -------------------------------------------------------------- // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, see . // // ---------------------------------------------------------------------------- // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ using System.Runtime.InteropServices; namespace DiscImageChef.DiscImages { public partial class Qcow2 { /// /// QCOW header, big-endian /// [StructLayout(LayoutKind.Sequential, Pack = 1)] struct QCow2Header { /// /// /// public uint magic; /// /// Must be 1 /// public uint version; /// /// Offset inside file to string containing backing file /// public ulong backing_file_offset; /// /// Size of /// public uint backing_file_size; /// /// Cluster bits /// public uint cluster_bits; /// /// Size in bytes /// public ulong size; /// /// Encryption method /// public uint crypt_method; /// /// Size of L1 table /// public uint l1_size; /// /// Offset to L1 table /// public ulong l1_table_offset; /// /// Offset to reference count table /// public ulong refcount_table_offset; /// /// How many clusters does the refcount table span /// public uint refcount_table_clusters; /// /// Number of snapshots /// public uint nb_snapshots; /// /// Offset to QCowSnapshotHeader /// public ulong snapshots_offset; // Added in version 3 public ulong features; public ulong compat_features; public ulong autoclear_features; public uint refcount_order; public uint header_length; } } }