]> git.proxmox.com Git - qemu-server.git/commit
migration: fix calculation of bandwith limit for non-disk migration
authorFabian Ebner <f.ebner@proxmox.com>
Fri, 29 Jan 2021 15:11:35 +0000 (16:11 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 18 Apr 2021 16:30:41 +0000 (18:30 +0200)
commit2c4ba4c3ee5f815fd358af2aff8a7a07cbacae90
tree05f0857ea3ac40a327575eee15624e9ded4eb847
parent3276a434707e65f949009ffd6b306ce6da7eecc1
migration: fix calculation of bandwith limit for non-disk migration

The case with:
1. no generic 'migration' limit from the storage plugin
2. a migrate_speed limit in the VM config
was broken. It would assign 0 to migrate_speed when picking the minimum value
and then default to the default value. Fix it by checking if bwlimit is 0
before picking the minimum.

Also, make it a bit more readable by avoiding the trick of //-assigning bwlimit
before the units match up and relying on getting back the original bwlimit value
as the minimum. Instead, only ||-assign after the units match up and don't rely
on other things.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/QemuMigrate.pm