On 09/21/2015 01:57 AM, Kevin Wolf wrote:

>>> +    - "wr_highest_offset": The offset after the greatest byte written to 
>>> the
>>> +                           BlockDriverState since it has been opened 
>>> (json-int)
>>
>> ...someday, I'd really like to have this stat show as non-zero even when
>> first opening the device (before writing to it). Right now, you have no
>> clue how full a backing device is prior to starting a block-commit; you
>> have to start writing to it to get a feel for its current usage.
> 
> With which value would it start? You don't want the file/device size
> because for block devices that's more than is actually used yet.
> 
> What you really want to know is a number for the parent node, which
> isn't readily available for qcow2 (you would have to scan the refcounts
> in the last refcount block on startup) and doesn't really exist for most
> other formats (very few of them can be used on block devices, most rely
> on the file size).

Libvirt only uses the stat on qcow2 format atop block devices, and uses
it precisely because that is the one place where relying on device size
is wrong.  And yes, it really WOULD be nice for the value to read the
last refcount block on startup, as that IS the correct value.

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