Re: [PATCH] qcow2: Fix preallocation on block devices

2020-05-07 Thread Kevin Wolf
Am 05.05.2020 um 16:18 hat Max Reitz geschrieben: > Calling bdrv_getlength() to get the pre-truncate file size will not > really work on block devices, because they have always the same length, > and trying to write beyond it will fail with a rather cryptic error > message. > > Instead, we should

[PATCH] qcow2: Fix preallocation on block devices

2020-05-05 Thread Max Reitz
Calling bdrv_getlength() to get the pre-truncate file size will not really work on block devices, because they have always the same length, and trying to write beyond it will fail with a rather cryptic error message. Instead, we should use qcow2_get_last_cluster() and bdrv_getlength() only as a