]> git.proxmox.com Git - mirror_qemu.git/commit - qemu-img.c
qcow2: Increase maximum cluster size to 2 MB
authorKevin Wolf <kwolf@redhat.com>
Tue, 15 Sep 2009 10:30:43 +0000 (12:30 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 5 Oct 2009 14:32:52 +0000 (09:32 -0500)
commit80ee15a6b274dfcedb0ad7db8c9e7d392210d6a1
tree4e20de957cf3d4709dd95082c96b9b1a7f8e3807
parent85352471ce78d73b8306822959caace2e8880535
qcow2: Increase maximum cluster size to 2 MB

This patch increases the maximum qcow2 cluster size to 2 MB. Starting with 128k
clusters, L2 tables span 2 GB or more of virtual disk space, causing 32 bit
truncation and wraparound of signed integers. Therefore some variables need to
use a larger data type.

While being at reviewing data types, change some integers that are used for
array indices to unsigned. In some places they were checked against some upper
limit but not for negative values. This could avoid potential segfaults with
corrupted qcow2 images.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block/qcow2-cluster.c
block/qcow2-refcount.c
block/qcow2.h
qemu-img.c