[libvirt] [PATCH v2] virsh: Checking the volume capacity before uploading a new file.

Julio Faracco jcfaracco at gmail.com
Sun Jan 21 23:54:03 UTC 2018


> +    if (volumeInfo.capacity < length) {
> +        vshError(ctl, _("lenth parameter is bigger than volume %s capacity"), name);
> +        goto cleanup;
> +    }
> +
> +    if (volumeInfo.capacity < fileLen + offset) {
> +        vshError(ctl, _("file is bigger than volume %s capacity"), name);
> +        goto cleanup;
> +    }
> +

I'm not totally right if I split this IF's or join them into a single IF.
I'm assuming that more information is better to understand the error.




More information about the libvir-list mailing list