qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 08/17] block: make bdrv_has_zero_init return


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 08/17] block: make bdrv_has_zero_init return false for copy-on-write-images
Date: Fri, 19 Jul 2013 07:21:05 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

On 07/16/2013 10:29 AM, Paolo Bonzini wrote:
> This helps implementing is_allocated on top of get_block_status.
> 
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  block.c    | 5 +++++
>  qemu-img.c | 9 +--------
>  2 files changed, 6 insertions(+), 8 deletions(-)

Reviewed-by: Eric Blake <address@hidden>

> +++ b/block.c
> @@ -2934,6 +2934,11 @@ int bdrv_has_zero_init(BlockDriverState *bs)
>  {
>      assert(bs->drv);
>  
> +    /* If BS is a copy on write image, it is initialized to
> +       the contents of the base image, which may not be zeroes.  */
> +    if (bs->backing_hd) {
> +        return 0;

Question (more for my understanding, not that you need to change code):
must we blindly return 0 in the presence of a backing file, or is it
possible to recursively query the backing_hd's zero_init status,
allowing us to return 1 iff all files in the chain support zero_init.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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