qcow2: Make size_to_clusters() return uint64_t
authorMax Reitz <mreitz@redhat.com>
Mon, 14 Sep 2015 14:39:47 +0000 (16:39 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 21 Oct 2015 01:18:17 +0000 (20:18 -0500)
commitc13b1c8314d1178161a1fa1a0c4d460bd4d66a64
tree76a1f69bae7690572539506f92c7dc9e6a60403c
parent052677b2c87779a6da6181b848825b29e65c0f54
qcow2: Make size_to_clusters() return uint64_t

Sadly, some images may have more clusters than what can be represented
using a plain int. We should be prepared for that case (in
qcow2_check_refcounts() we actually were trying to catch that case, but
since size_to_clusters() truncated the returned value, that check never
did anything useful).

Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit b6d36def6d9e9fd187327182d0abafc9b7085d8f)

Conflicts:
block/qcow2-cluster.c
block/qcow2.h

* removed context dependency on ff99129a
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2-cluster.c
block/qcow2-refcount.c
block/qcow2.h