-
Hu Tao authored
n_start can be actually calculated from offset. The number of sectors to be allocated(n_end - n_start) can be passed in in num. By removing n_start and n_end, we can save two parameters. The side effect is there is a bug in qcow2.c:preallocate() that passes incorrect n_start to qcow2_alloc_cluster_offset() is fixed. The bug can be triggerred by a larger cluster size than the default value(65536), for example: ./qemu-img create -f qcow2 \ -o 'cluster_size=131072,preallocation=metadata' file.img 4G Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by:
Max Reitz <mreitz@redhat.com>
Reviewed-by:
Benoit Canet <benoit@irqsave.net>
Signed-off-by:
Kevin Wolf <kwolf@redhat.com>Hu Tao authoredn_start can be actually calculated from offset. The number of sectors to be allocated(n_end - n_start) can be passed in in num. By removing n_start and n_end, we can save two parameters. The side effect is there is a bug in qcow2.c:preallocate() that passes incorrect n_start to qcow2_alloc_cluster_offset() is fixed. The bug can be triggerred by a larger cluster size than the default value(65536), for example: ./qemu-img create -f qcow2 \ -o 'cluster_size=131072,preallocation=metadata' file.img 4G Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by:
Max Reitz <mreitz@redhat.com>
Reviewed-by:
Benoit Canet <benoit@irqsave.net>
Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
Loading