[pve-devel] [PATCH v3 storage 1/2] volume_resize: use KiB instead of bytes

Dominik Csapak d.csapak at proxmox.com
Wed Feb 19 10:53:30 CET 2020


On 2/19/20 10:10 AM, Thomas Lamprecht wrote:
> On 2/17/20 12:41 PM, Fabian Ebner wrote:
>> Avoid some problems with 'qemu-img resize', which expects
>> that the size is a multiple of 512 bytes for qcow2 images.
>>
>> Since vdisk_alloc already uses KiB, this also improves
>> consistency a little.
>>
>> The tests for ZFS are also adapted to the new interface.
>>
>> Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
>> ---
>>
>> Changes from v2:
>>      * align to 1024 instead of 512 bytes
>>      * change the interface for volume_resize
>>
>> Because of the interface change, dependency bumps are needed.
> 
> This effectively changes the storage plugin ABI, so we need to handle that:
> * adapting VERSION/AGE (needs a bit of thought to be sure to get it right)
>    not to cool as we do not just want to bumo the version/age for some nicer
>    $size interface..
> * keep existing stuff backward compatible, rather ugly as it is sure way
>    to add cruft..
> 
> Thoughts?
> 

mhmm.. did not think of that :(

maybe a nicer way that would justify an abi bump would be
to define a 'minimum granularity' per storage plugin
and calling a plugins 'resize' would convert beforehand

this way we can assume the size in the plugin specific
sub to be the right unit (and can drop the conversions there)
and can say the 'default' granularity is 1 byte (for compatibility)

maybe that info could also be reflected in the (api) docs/manpages?





More information about the pve-devel mailing list