On 4/28/20 8:26 AM, Max Reitz wrote:
Branch: https://github.com/XanClic/qemu.git fix-bdrv_make_empty-v1
Branch: https://git.xanclic.moe/XanClic/qemu.git fix-bdrv_make_empty-v1
Hi,
Right now, there is no centralized bdrv_make_empty() function. Not only
is it bad style to call BlockDriver methods directly, it is also wrong,
unless the caller has a BdrvChild with BLK_PERM_WRITE taken.
I'm also in the middle of writing a patch series that adds a
corresponding .bdrv_make_empty driver callback. I'll rebase that work
on top of this, as part of my efforts at fixing more code to rely on
bdrv_make_empty rather than directly querying
bdrv_has_zero_init[_truncate].