[libvirt] [PATCHv5 03/19] storage: gluster: Add backend to return unique storage file path

Eric Blake eblake at redhat.com
Tue Jun 24 03:35:48 UTC 2014


On 06/19/2014 07:59 AM, Peter Krempa wrote:
> Use virStorageFileSimplifyPathInternal to canonicalize gluster paths
> via a callback and use it for the unique volume path retrieval API.
> ---
>  src/storage/storage_backend_gluster.c | 80 +++++++++++++++++++++++++++++++++++
>  1 file changed, 80 insertions(+)
> 

> +
> + realloc:
> +    if (VIR_EXPAND_N(buf, bufsiz, 256) < 0)

Expanding by the same length each iteration is quadratic in behavior,
compared to expanding by a geometrically larger value (256 on iteration
1, 512 on iteration 2, ...). BUT, that is true only if you return to the
label more than once.  However, gluster has some (current) hard-baked
limits of 256 as the maximum length, so you will only be repeating the
label at most once, so it really doesn't matter in this patch :)

ACK

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140623/01305c5f/attachment-0001.sig>


More information about the libvir-list mailing list