mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-06 02:25:06 +00:00
clone disk: don't modify drive parameter
While existing callers are not using the parameter after the call, the modification is rather unexpected and could lead to bugs quickly. Also avoid setting an undef value in the hash, but use delete instead. Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
bdf6ba1e7d
commit
3b53c47155
@ -7642,8 +7642,8 @@ sub clone_disk {
|
||||
no_data_clone:
|
||||
my ($size) = eval { PVE::Storage::volume_size_info($storecfg, $newvolid, 10) };
|
||||
|
||||
my $disk = $drive;
|
||||
$disk->{format} = undef;
|
||||
my $disk = dclone($drive);
|
||||
delete $disk->{format};
|
||||
$disk->{file} = $newvolid;
|
||||
$disk->{size} = $size if defined($size);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user