]> git.proxmox.com Git - mirror_qemu.git/commit - block/qcow2-cluster.c
qcow2: Name typedef for cluster type
authorEric Blake <eblake@redhat.com>
Sun, 7 May 2017 00:05:45 +0000 (19:05 -0500)
committerMax Reitz <mreitz@redhat.com>
Thu, 11 May 2017 12:28:06 +0000 (14:28 +0200)
commit3ef9521893c41638148d4452ee4da75fd8ef71a9
tree9dee34fb20940649bcfc503c0cac5ea98c670caf
parent4341df8a83d6a528a1e2855735f87fc3aab42b70
qcow2: Name typedef for cluster type

Although it doesn't add all that much type safety (this is C, after
all), it does add a bit of legibility to use the name QCow2ClusterType
instead of a plain int.

In particular, qcow2_get_cluster_offset() has an overloaded return
type; a QCow2ClusterType on success, and -errno on failure; keeping
the cluster type in a separate variable makes it slightly easier for
the next patch to make further computations based on the type.

Suggested-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-id: 20170507000552.20847-6-eblake@redhat.com
[mreitz: Use the new type in two more places (one of them pulled from
         the next patch)]
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2-cluster.c
block/qcow2-refcount.c
block/qcow2.h