// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // 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-2025 Natalia Portillo // ****************************************************************************/ using System.Runtime.InteropServices; namespace Aaru.Images; public sealed partial class Qcow2 { #region Nested type: Header /// QCOW header, big-endian [StructLayout(LayoutKind.Sequential, Pack = 1)] struct Header { /// /// /// public uint magic; /// Must be 1 public uint version; /// Offset inside file to string containing backing file public readonly ulong backing_file_offset; /// Size of public readonly uint backing_file_size; /// Cluster bits public uint cluster_bits; /// Size in bytes public ulong size; /// Encryption method public readonly 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 readonly uint nb_snapshots; /// Offset to QCowSnapshotHeader public readonly ulong snapshots_offset; // Added in version 3 public readonly ulong features; public readonly ulong compat_features; public readonly ulong autoclear_features; public readonly uint refcount_order; public uint header_length; } #endregion }