On 18.09.19 22:52, Maxim Levitsky wrote: > On Wed, 2019-09-18 at 11:51 +0200, Max Reitz wrote: >> This is a change in behavior, so all instances need a good >> justification. The comments added here should explain my reasoning. >> >> qed already had a comment that suggests it always expected >> bdrv_truncate()/blk_truncate() to behave as if exact=true were passed >> (c743849bee7 came eight months before 55b949c8476), so it was simply >> broken until now. >> >> Signed-off-by: Max Reitz <mre...@redhat.com> >> --- >> block/parallels.c | 11 +++++++++-- >> block/qcow2.c | 6 +++++- >> block/qed.c | 2 +- >> qemu-img.c | 7 ++++++- >> qemu-io-cmds.c | 7 ++++++- >> 5 files changed, 27 insertions(+), 6 deletions(-)
[...] >> diff --git a/block/qed.c b/block/qed.c >> index 7c2a65af40..8005cfc305 100644 >> --- a/block/qed.c >> +++ b/block/qed.c >> @@ -674,7 +674,7 @@ static int coroutine_fn >> bdrv_qed_co_create(BlockdevCreateOptions *opts, >> l1_size = header.cluster_size * header.table_size; >> >> /* File must start empty and grow, check truncate is supported */ > I would update the above comment, with something like > > "QED format requires the underlying file to have the exact expected length, > which is 0 on creation" > Or something similar. I’ll change it to: The QED format associates file length with allocation status, so a new file (which is empty) must have a length of 0. Hope that’s OK. :-) Max
signature.asc
Description: OpenPGP digital signature