[Top][All Lists]

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

Re: [Qemu-block] [PATCH 2/7] block: add bdrv_get_format_allocated_size f

From: Eric Blake
Subject: Re: [Qemu-block] [PATCH 2/7] block: add bdrv_get_format_allocated_size format interface
Date: Thu, 25 May 2017 12:54:36 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 05/25/2017 10:26 AM, Vladimir Sementsov-Ogievskiy wrote:
> The function should return actually used by top-level format driver

s/actually/the allocation actually/

> space (in it's .file). It differs from bdrv_get_allocated_file_size,

s/it's/its/ (remember, "it's" is only appropriate if "it is" can be used
in its place)

> which returns allocated on fs file size.

s/allocated on fs file size/the disk usage of the underlying file/

So this is a measure of how many clusters a qcow2 image is currently
using (including metadata clusters, and regardless of whether those
clusters happen to point to a hole in the underlying protocol layer)?

> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
>  block.c                   | 15 +++++++++++++++
>  include/block/block.h     |  1 +
>  include/block/block_int.h |  1 +
>  3 files changed, 17 insertions(+)
> diff --git a/block.c b/block.c
> index ba22fc0dfb..6e1a435490 100644
> --- a/block.c
> +++ b/block.c
> @@ -3407,6 +3407,21 @@ int64_t bdrv_get_allocated_file_size(BlockDriverState 
> *bs)
>  }
>  /**
> + * Actually used by top-level format driver space (in it's .file) in bytes


I think we can do better.  How about:

Return the amount of space allocated by the format driver (including
metadata) in bytes, even if some of that space currently maps to holes
in the underlying protocol file.

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

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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