[pve-devel] [PATCH storage 2/3] status: add new-filename to upload

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jul 20 15:27:32 CEST 2021


On 20.07.21 13:51, Lorenz Stechauner wrote:
> Signed-off-by: Lorenz Stechauner <l.stechauner at proxmox.com>
> ---
>  PVE/API2/Storage/Status.pm | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/PVE/API2/Storage/Status.pm b/PVE/API2/Storage/Status.pm
> index b549d7d..eac5e13 100644
> --- a/PVE/API2/Storage/Status.pm
> +++ b/PVE/API2/Storage/Status.pm
> @@ -378,9 +378,15 @@ __PACKAGE__->register_method ({
>  	    content => {
>  		description => "Content type.",
>  		type => 'string', format => 'pve-storage-content',
> +		enum => ['iso', 'vztmpl'],

unrelated change? That could be send as its own patch, does not even needs to be a
part of this series.

>  	    },
>  	    filename => {
> -		description => "The name of the file to create.",
> +		description => "The original name of the file.",
> +		type => 'string',
> +	    },
> +	    'new-filename' => {
> +		description => "The name of the file to create. Caution: This will be normalized!",
> +		maxLength => 255,

new non optional API parameter would be an ABI break, 7.0 is released, that won't
fly anymore for ~1.9 years ;-)

Rather, make it optional and fallback to the filename (or whatever makes it
actually backward compatible).

>  		type => 'string',
>  	    },
>  	    tmpfilename => {
> @@ -414,7 +420,7 @@ __PACKAGE__->register_method ({
>  	my $size = -s $tmpfilename;
>  	die "temporary file '$tmpfilename' does not exist\n" if !defined($size);
>  
> -	my $filename = PVE::Storage::normalize_content_filename($param->{filename});
> +	my $filename = PVE::Storage::normalize_content_filename($param->{'new-filename'});
>  
>  	my $path;
>  
> 






More information about the pve-devel mailing list