Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/ext2fs
File: qcow2.h
/*
[0] Fix | Delete
* qcow2.h --- structures and function prototypes for qcow2.c to generate
[1] Fix | Delete
* qcow2 formatted disk images. This format is used originally by QEMU
[2] Fix | Delete
* for virtual machines, and stores the filesystem data on disk in a
[3] Fix | Delete
* packed format to avoid creating sparse image files that need lots of
[4] Fix | Delete
* seeking to read and write.
[5] Fix | Delete
*
[6] Fix | Delete
* The qcow2 format supports zlib compression, but that is not yet
[7] Fix | Delete
* implemented.
[8] Fix | Delete
*
[9] Fix | Delete
* It is possible to directly mount a qcow2 image using qemu-nbd:
[10] Fix | Delete
*
[11] Fix | Delete
* [root]# modprobe nbd max_part=63
[12] Fix | Delete
* [root]# qemu-nbd -c /dev/nbd0 image.img
[13] Fix | Delete
* [root]# mount /dev/nbd0p1 /mnt/qemu
[14] Fix | Delete
*
[15] Fix | Delete
* Format details at http://people.gnome.org/~markmc/qcow-image-format.html
[16] Fix | Delete
*
[17] Fix | Delete
* Copyright (C) 2010 Red Hat, Inc., Lukas Czerner <lczerner@redhat.com>
[18] Fix | Delete
*
[19] Fix | Delete
* %Begin-Header%
[20] Fix | Delete
* This file may be redistributed under the terms of the GNU Public
[21] Fix | Delete
* License.
[22] Fix | Delete
* %End-Header%
[23] Fix | Delete
*/
[24] Fix | Delete
[25] Fix | Delete
/* Number of l2 tables in memory before writeback */
[26] Fix | Delete
#define L2_CACHE_PREALLOC 512
[27] Fix | Delete
[28] Fix | Delete
[29] Fix | Delete
#define QCOW_MAGIC (('Q' << 24) | ('F' << 16) | ('I' << 8) | 0xfb)
[30] Fix | Delete
#define QCOW_VERSION 2
[31] Fix | Delete
#define QCOW_OFLAG_COPIED (1ULL << 63)
[32] Fix | Delete
#define QCOW_OFLAG_COMPRESSED (1ULL << 62)
[33] Fix | Delete
[34] Fix | Delete
#define QCOW_COMPRESSED 1
[35] Fix | Delete
#define QCOW_ENCRYPTED 2
[36] Fix | Delete
#define QCOW_CORRUPTED 3
[37] Fix | Delete
[38] Fix | Delete
struct ext2_qcow2_hdr {
[39] Fix | Delete
__u32 magic;
[40] Fix | Delete
__u32 version;
[41] Fix | Delete
[42] Fix | Delete
__u64 backing_file_offset;
[43] Fix | Delete
__u32 backing_file_size;
[44] Fix | Delete
[45] Fix | Delete
__u32 cluster_bits;
[46] Fix | Delete
__u64 size;
[47] Fix | Delete
__u32 crypt_method;
[48] Fix | Delete
[49] Fix | Delete
__u32 l1_size;
[50] Fix | Delete
__u64 l1_table_offset;
[51] Fix | Delete
[52] Fix | Delete
__u64 refcount_table_offset;
[53] Fix | Delete
__u32 refcount_table_clusters;
[54] Fix | Delete
[55] Fix | Delete
__u32 nb_snapshots;
[56] Fix | Delete
__u64 snapshots_offset;
[57] Fix | Delete
};
[58] Fix | Delete
[59] Fix | Delete
typedef struct ext2_qcow2_l2_table L2_CACHE_HEAD;
[60] Fix | Delete
[61] Fix | Delete
struct ext2_qcow2_l2_table {
[62] Fix | Delete
__u32 l1_index;
[63] Fix | Delete
__u64 offset;
[64] Fix | Delete
__u64 *data;
[65] Fix | Delete
L2_CACHE_HEAD *next;
[66] Fix | Delete
};
[67] Fix | Delete
[68] Fix | Delete
struct ext2_qcow2_l2_cache {
[69] Fix | Delete
L2_CACHE_HEAD *used_head;
[70] Fix | Delete
L2_CACHE_HEAD *used_tail;
[71] Fix | Delete
L2_CACHE_HEAD *free_head;
[72] Fix | Delete
__u32 free;
[73] Fix | Delete
__u32 count;
[74] Fix | Delete
__u64 next_offset;
[75] Fix | Delete
};
[76] Fix | Delete
[77] Fix | Delete
struct ext2_qcow2_refcount {
[78] Fix | Delete
__u64 *refcount_table;
[79] Fix | Delete
__u64 refcount_table_offset;
[80] Fix | Delete
__u64 refcount_block_offset;
[81] Fix | Delete
[82] Fix | Delete
__u32 refcount_table_clusters;
[83] Fix | Delete
__u32 refcount_table_index;
[84] Fix | Delete
__u32 refcount_block_index;
[85] Fix | Delete
[86] Fix | Delete
__u16 *refcount_block;
[87] Fix | Delete
};
[88] Fix | Delete
[89] Fix | Delete
struct ext2_qcow2_image {
[90] Fix | Delete
int fd;
[91] Fix | Delete
struct ext2_qcow2_hdr *hdr;
[92] Fix | Delete
struct ext2_qcow2_l2_cache *l2_cache;
[93] Fix | Delete
struct ext2_qcow2_refcount refcount;
[94] Fix | Delete
__u32 cluster_size;
[95] Fix | Delete
__u32 cluster_bits;
[96] Fix | Delete
__u32 l1_size;
[97] Fix | Delete
__u32 l2_size;
[98] Fix | Delete
[99] Fix | Delete
__u64 *l1_table;
[100] Fix | Delete
__u64 l2_offset;
[101] Fix | Delete
__u64 l1_offset;
[102] Fix | Delete
__u64 image_size;
[103] Fix | Delete
};
[104] Fix | Delete
[105] Fix | Delete
/* Function prototypes */
[106] Fix | Delete
[107] Fix | Delete
/* qcow2.c */
[108] Fix | Delete
[109] Fix | Delete
/* Functions for converting qcow2 image into raw image */
[110] Fix | Delete
struct ext2_qcow2_hdr *qcow2_read_header(int);
[111] Fix | Delete
int qcow2_write_raw_image(int, int, struct ext2_qcow2_hdr *);
[112] Fix | Delete
[113] Fix | Delete
[114] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function