mirror of
git://git.proxmox.com/git/pve-storage.git
synced 2025-01-24 02:04:13 +03:00
get bandwidth limit: improve detecting if storages are involved
Previously, calling with e.g. $storage_list = [undef] would lead to an early return of $override and not consider the limit from datacenter.cfg. Refactoring the bandwidth limit handling for migration introduced calls such as described above, which broke applying the limit from datacenter.cfg for VM RAM/state migration. Reported in the community forum: https://forum.proxmox.com/threads/37920/post-513005 Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
b9e309d667
commit
0227e28e8e
@ -2082,7 +2082,7 @@ sub get_bandwidth_limit {
|
||||
}
|
||||
|
||||
# Apply per-storage limits - if there are storages involved.
|
||||
if (defined($storage_list) && @$storage_list) {
|
||||
if (defined($storage_list) && grep { defined($_) } $storage_list->@*) {
|
||||
my $config = config();
|
||||
|
||||
# The Datastore.Allocate permission allows us to modify the per-storage
|
||||
|
@ -109,6 +109,8 @@ my @tests = (
|
||||
[ ['restore', ['d50m40r30'], 0], 0, 'root / specific storage limit (restore)' ],
|
||||
[ ['migrate', undef, 100], 100, 'root / undef storage (migrate)' ],
|
||||
[ ['migrate', [], 100], 100, 'root / no storage (migrate)' ],
|
||||
[ ['migrate', [undef], undef], 100, 'root / [undef] storage no override (migrate)' ],
|
||||
[ ['migrate', [undef, undef], 200], 200, 'root / list of undef storages with override (migrate)' ],
|
||||
|
||||
[ user => 'user1@test' ],
|
||||
[ ['unknown', ['nolimit'], undef], 100, 'generic default limit' ],
|
||||
@ -189,6 +191,9 @@ my @tests = (
|
||||
[ ['restore', ['nolimit', 'd20m40r30'], undef], 30, 'multiple storages specific limit with privileges on one of them (default limited) (restore)' ],
|
||||
[ ['restore', ['d20m40r30', 'm50'], 200], 60, 'multiple storages specific limit with privileges on one of them (global default limited) (restore)' ],
|
||||
[ ['move', ['nolimit', undef ], 40] , 40, 'multiple storages one undefined, passing 40 (move)' ],
|
||||
[ ['move', undef, 100] , 80, 'undef storage, passing 100 (move)' ],
|
||||
[ ['move', [undef], 100] , 80, '[undef] storage, passing 100 (move)' ],
|
||||
[ ['move', [undef], undef] , 80, '[undef] storage, no override (move)' ],
|
||||
);
|
||||
|
||||
foreach my $t (@tests) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user