Bug 1083483
Summary: | The guest migrate very slow while set the migrate-speed to -1 | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | zhenfeng wang <zhwang> |
Component: | libvirt | Assignee: | Jiri Denemark <jdenemar> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.5 | CC: | ajia, dyuan, gsun, jdenemar, mzhan, rbalakri, ydu, zhwang, zpeng |
Target Milestone: | rc | Keywords: | Reopened, Upstream |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-0.10.2-34.el6 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-10-14 04:21:03 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
zhenfeng wang
2014-04-02 10:34:26 UTC
I suspect this is something deep in qemu. But I don't see any reason for trying to increase the bandwidth from something that is already more than one can currently achieve (8796093022207 MiB/s is 8EiB/s). Thus I think this is not worth fixing given that it has already been fixed upstream/RHEL-7. Development Management has reviewed and declined this request. You may appeal this decision by reopening this request. Oh, I was judging just by the fact it works in RHEL-7 and since libvirt did not change in this part, I though our code was correct. I should have double checked :-) QEMU likely changed something so that it started working but libvirt code is what needs to be fixed. The default maximum migration speed of 8796093022207 MiB/s is INT64_MAX / (1024 * 1024), where INT64_MAX is the maximum value QEMU supports and we need to divide it by 1024 * 1024 because QEMU takes B/s while we use MiB/s. When virsh migrate-setspeed gets -1, it calls virDomainMigrateSetMaxSpeed API with bandwidth = 18446744073709551615 (which is (uint64_t) -1), libvirt then happily takes that, multiplies it by 1024 * 1024 and sends {"execute":"migrate_set_speed","arguments":{"value":-1048576},"id":"libvirt-8"} QMP command to QEMU. The magic -1048576 (-1 * 1024 * 1024) value is a result of taking 18446744073709551615, multiplying it by 1024 * 1024, which overflows to 18446744073708503040, and casting it to long long when creating JSON objects. All that said, libvirt should either forbid or silently crop migration speed to QEMU_DOMAIN_MIG_BANDWIDTH_MAX. Now fixed upstream by v1.2.3-125-gc4206d7: commit c4206d7c7e2c82bcdabd8a7548e14c48cdab4e14 Author: Jiri Denemark <jdenemar> Date: Fri Apr 11 11:24:51 2014 +0200 qemu: Avoid overflow when setting migration speed When passing migration bandwidth to QEMU, we multiply it by 1024 * 1024 to convert the speed to B/s and the result still needs to fit in int64_t. https://bugzilla.redhat.com/show_bug.cgi?id=1083483 Signed-off-by: Jiri Denemark <jdenemar> https://www.redhat.com/archives/libvir-list/2014-April/msg00992.html is needed to fix similar bug in case the domain is not running. The additional patch is now upstream as v1.2.3-190-gdff3ad0: commit dff3ad004acd2c8754a76553742cc5c18c77766c Author: Jiri Denemark <jdenemar> Date: Fri Apr 11 11:24:51 2014 +0200 qemu: Avoid overflow when setting migration speed on inactive domains Commit c4206d7 fixed the overflow for running domains. However, we need a similar check when setting migration speed on inactive domains. At first look, it may seem the check in c4206d7 is now redundant but qemuDomainMigrateSetMaxSpeed is not the only caller of qemuMonitorSetMigrationSpeed so we need to check the bandwidth in both places. https://bugzilla.redhat.com/show_bug.cgi?id=1083483 Signed-off-by: Jiri Denemark <jdenemar> I can reproduce this. Verify with build: libvirt-0.10.2-40.el6.x86_64 step: for active guest: #virsh domstate rhel6 running #virsh migrate-setspeed rhel6 -1 error: numerical overflow: bandwidth must be less than 8796093022208 for inactive guest: # virsh domstate rhel6 shut off #virsh migrate-setspeed rhel6 -1 error: numerical overflow: bandwidth must be less than 8796093022208 try others value of speed 18446744073709551615 0 8796093022208 all can get the error, move to verified. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-1374.html |