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 <pbonz...@redhat.com>
> ---
>  block.c    | 5 +++++
>  qemu-img.c | 9 +--------
>  2 files changed, 6 insertions(+), 8 deletions(-)

Reviewed-by: Eric Blake <ebl...@redhat.com>

> +++ 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