On 23.07.20 17:51, Andrey Shinkevich wrote: > On 25.06.2020 18:22, Max Reitz wrote: >> Signed-off-by: Max Reitz <mre...@redhat.com> >> --- >> block/backup-top.c | 2 +- >> block/backup.c | 9 +++++---- >> blockdev.c | 19 +++++++++++++++---- >> 3 files changed, 21 insertions(+), 9 deletions(-) >> >> >> diff --git a/block/backup.c b/block/backup.c >> index 4f13bb20a5..9afa0bf3b4 100644 >> --- a/block/backup.c >> +++ b/block/backup.c >> @@ -297,6 +297,7 @@ static int64_t >> backup_calculate_cluster_size(BlockDriverState *target, >> { >> int ret; >> BlockDriverInfo bdi; >> + bool target_does_cow = bdrv_backing_chain_next(target); >> > > > Wouldn't it better to make the explicit type conversion or use "!!" > approach?
I don’t know. O:) I personally don’t like too may exclamation marks because I feel like the code is screaming at me. So I tend to use them only where necessary. As for doing an explicit cast... I think I’ll keep that in mind to reduce my future use of !!. But in this case, the type name is in the same line, so I feel like it’s sufficiently clear. Max
signature.asc
Description: OpenPGP digital signature