qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH] qemu-img: return allocated size fo


From: Max Reitz
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH] qemu-img: return allocated size for block device with qcow2 format
Date: Wed, 2 May 2018 17:33:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 2018-05-02 17:19, Eric Blake wrote:
> On 05/02/2018 10:13 AM, Max Reitz wrote:
> 
>>> We also recently added 'qemu-img measure', which DOES report how many
>>> clusters are in use.  Is any of that reusable here?
>>
>> It only tells you that information for a hypothetical new image, though,
>> doesn't it?
> 
> It has two uses: with just a size, estimate the overhead needed to
> create a file with the given format and exposing the given size to the
> guest (both sparse and fully allocated sizes are estimated); and with a
> pre-existing image, compute the exact overhead needed for 'qemu-img
> convert' to create a new image with the given format and the same
> guest-visible contents.  The latter use, where it uses an existing guest
> image as the starting point to measure, indeed only tells you what a
> hypothetical new image will occupy (the used cluster count, not the
> wr_highest_offset count) - but isn't that what you want?

As far as I can tell, it only uses allocation status of the active layer
to determine how much of the hypothetical new image would be allocated
(the man page says "as if converting an existing image file using
qemu-img convert").  But this patch tries to determine exactly how much
is allocated in the current image for everything, not just how much you
need to have allocated to represent the active layer.

That may include snapshots, but it also includes bitmaps, or allocated
zero clusters (which qemu-img measure discounts), or things like empty
L2 tables.  So, everything.

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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