qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/4] block: Do not call BlockDriver.bdrv_make_empty() directl


From: Eric Blake
Subject: Re: [PATCH 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly
Date: Tue, 28 Apr 2020 09:05:54 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 4/28/20 8:49 AM, Eric Blake wrote:
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].

Correction - I'm working on adding .bdrv_make_zero, not .bdrv_make empty (which already exists), although maybe it really only needs to be one callback instead of two if we have decent flags.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]