[pve-devel] applied: [PATCH qemu-server] Create linked clone failed, uninitialized storage

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Apr 5 14:48:43 CEST 2019


On 4/5/19 2:35 PM, Alwin Antreich wrote:
> When creating a linked clone the storage parameter is not defined. The
> get_bandwidth_limit method got a undef element for its storage_list and
> therefore failed on trying to set the bandwidth limit.
> 

applied but rewrote commit message a bit, as the issue is not the linked clone
persè but rather the case when we omit (target) storage and thus fallback to
target storage == source storage, which we did not handle when adding the clone
bwlimits.

> This patch only pushes the storage parameter into the storage_list array
> if it is defined.
> 
> Signed-off-by: Alwin Antreich <a.antreich at proxmox.com>
> ---
>  PVE/API2/Qemu.pm | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index 5469089..638455e 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -2854,7 +2854,9 @@ __PACKAGE__->register_method({
>  			my $skipcomplete = ($total_jobs != $i); # finish after last drive
>  
>  			my $src_sid = PVE::Storage::parse_volume_id($drive->{file});
> -			my $clonelimit = PVE::Storage::get_bandwidth_limit('clone', [$src_sid, $storage], $bwlimit);
> +			my $storage_list = [$src_sid];
> +			push @$storage_list, $storage if (defined($storage));
> +			my $clonelimit = PVE::Storage::get_bandwidth_limit('clone', $storage_list, $bwlimit);
>  
>  			my $newdrive = PVE::QemuServer::clone_disk($storecfg, $vmid, $running, $opt, $drive, $snapname,
>  								   $newid, $storage, $format, $fullclone->{$opt}, $newvollist,
> 





More information about the pve-devel mailing list