• Kevin Wolf's avatar
    qcow2: Increase maximum cluster size to 2 MB · 80ee15a6
    Kevin Wolf authored
    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: default avatarKevin Wolf <kwolf@redhat.com>
    Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    80ee15a6
qemu-img.c 30 KB