diff options
author | Eric Blake <eblake@redhat.com> | 2017-05-06 19:05:46 -0500 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2017-05-11 14:28:07 +0200 |
commit | fdfab37dfeffefbd4533b4158055c9b82d7c3e69 (patch) | |
tree | d02d0737168042286445a6d6187eb8fa662ed557 /spice-qemu-char.c | |
parent | 3ef9521893c41638148d4452ee4da75fd8ef71a9 (diff) |
qcow2: Make distinction between zero cluster types obvious
Treat plain zero clusters differently from allocated ones, so that
we can simplify the logic of checking whether an offset is present.
Do this by splitting QCOW2_CLUSTER_ZERO into two new enums,
QCOW2_CLUSTER_ZERO_PLAIN and QCOW2_CLUSTER_ZERO_ALLOC.
I tried to arrange the enum so that we could use
'ret <= QCOW2_CLUSTER_ZERO_PLAIN' for all unallocated types, and
'ret >= QCOW2_CLUSTER_ZERO_ALLOC' for allocated types, although
I didn't actually end up taking advantage of the layout.
In many cases, this leads to simpler code, by properly combining
cases (sometimes, both zero types pair together, other times,
plain zero is more like unallocated while allocated zero is more
like normal).
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-id: 20170507000552.20847-7-eblake@redhat.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'spice-qemu-char.c')
0 files changed, 0 insertions, 0 deletions