summaryrefslogtreecommitdiffstats
path: root/presentation/images/qcow2_reading.tex
blob: ed11d93920473f228d2ef39feeb1d33d02503d1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
%-------------------------------------------------------------------------------
% qcow2_reading.tex - shows how QCOW2 clusters are mapped for reading
%-------------------------------------------------------------------------------
% author   : Manuel Bentele
% date     : Aug 29, 2019
% copyright: (c) 2019 Manuel Bentele
%-------------------------------------------------------------------------------

\begin{tikzpicture}[
        arrow/.style = {-triangle 45}
    ]
    \node[inner sep = 0, anchor = north] (blkdev) at (0, 0) {
        \renewcommand*{\arraystretch}{1.3}
        \begin{tabular}{|c|} \hline
                            \\ \hline
                            \\ \hline
                            \\ \hline
                            \\ \hline
            \cellcolor{dat} \\ \hline
                            \\ \hline
            \cellcolor{dat} \\ \hline
            \cellcolor{dat} \\ \hline
                            \\ \hline
            \cellcolor{dat} \\ \hline
        \end{tabular}
    };

    \node[inner sep = 0, anchor = north, right = of blkdev] (qcow2) {
        \renewcommand*{\arraystretch}{1.3}
        \hspace*{-0.25cm}
        \begin{tabular}{|c|} \hline
            \cellcolor{hdr}Header         \\ \hline
            \cellcolor{ret}Refcount table \\ \hline
            \cellcolor{reb}Refcount block \\ \hline
            \cellcolor{l1t}L1~table       \\ \hline
            \cellcolor{l2t}L2~table       \\ \hline
            \cellcolor{dat}Data cluster   \\ \hline
            \cellcolor{l2t}L2~table       \\ \hline
            \cellcolor{dat}Data cluster   \\ \hline
            \cellcolor{dat}Data cluster   \\ \hline
            \cellcolor{dat}Data cluster   \\ \hline
        \end{tabular}
    };

    \draw[triangle 45-triangle 45] ($(blkdev.north west)!0!(blkdev.south west)$) -- node[left] {$O$} ($(blkdev.north west)!0.6!(blkdev.south west)$);
    \draw[triangle 45-triangle 45] ($(blkdev.north west)!0.6!(blkdev.south west)$) -- node[left] {$S$} ($(blkdev.north west)!0.8!(blkdev.south west)$);

    \node[above = 0.5 of blkdev, align = center] {Block\\device};
    \node[above = 0.5 of qcow2, align = center] {QCOW2\\file format};

    \draw[arrow] ($(blkdev.north east)!0.45!(blkdev.south east)$) -- ($(qcow2.north west)!0.75!(qcow2.south west)$);
    \draw[arrow] ($(blkdev.north east)!0.65!(blkdev.south east)$) -- ($(qcow2.north west)!0.55!(qcow2.south west)$);
    \draw[arrow] ($(blkdev.north east)!0.75!(blkdev.south east)$) -- ($(qcow2.north west)!0.85!(qcow2.south west)$);
    \draw[arrow] ($(blkdev.north east)!0.95!(blkdev.south east)$) -- ($(qcow2.north west)!0.95!(qcow2.south west)$);
\end{tikzpicture}