Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
guest which use big maxmemory will lose track after restart libvirtd
Version-Release number of selected component (if applicable):
libvirt-1.2.17-7.el7.x86_64
How reproducible:
100%
Steps to Reproduce:
1. prepare a guest with 9007199254740991kib maxmem
# virsh dumpxml rhel7.0-rhel
<domain type='kvm'>
<name>rhel7.0-rhel</name>
<uuid>67c7a123-5415-4136-af62-a2ee098ba6cd</uuid>
<maxMemory slots='16' unit='KiB'>9007199254740991</maxMemory>
2. start it:
# virsh start rhel7.0-rhel
Domain rhel7.0-rhel started
# virsh list
Id Name State
----------------------------------------------------
21 rhel7.0-rhel running
3. restart libvirtd recheck:
# service libvirtd restart
Redirecting to /bin/systemctl restart libvirtd.service
# virsh list
Id Name State
----------------------------------------------------
and can find log in libvirtd.log
2015-09-07 09:46:04.280+0000: 3839: error : virScaleInteger:337 : numerical overflow: value too large: 9007199254740992KiB
Actual results:
guest which use big maxmemory will lose track after restart libvirtd, libvirt
call qemuDomainAlignMemorySizes change 9007199254740991 to 9007199254740992
Expected results:
guest still exist after restart libvirtd or get failure when start guest
Additional info:
commit 645881139b3d2c86acf9d644c3a1471520bc9e57
Author: Peter Krempa <pkrempa>
Date: Tue Dec 1 14:08:37 2015 +0100
qemu: domain: Prevent overflows in memory alignment code
Since libvirt for dubious historical reasons stores memory size as
kibibytes, it's possible that the alignments done in the qemu code
overflow the the maximum representable size in bytes. The XML parser
code handles them in bytes in some stages. Prevent this by doing
overflow checks when alinging the size and add a test case.
Verify this bug with libvirt-1.3.4-1.el7.x86_64:
1. prepare a inactive guest:
# virsh list --all
Id Name State
----------------------------------------------------
- rhel72-test shut off
2. change guest maxmemory to 9007199254740991KiB:
# virsh dumpxml rhel72-test |grep max
<maxMemory slots='16' unit='KiB'>9007199254740991</maxMemory>
3. start guest:
# virsh start rhel72-test
error: Failed to start domain rhel72-test
error: unsupported configuration: maximum memory size overflowed after alignment
4. change guest memory to 9007199254740991KiB:
# virsh dumpxml rhel72 |grep emory
<memory unit='KiB'>9007199254740991</memory>
<currentMemory unit='KiB'>9007199254740991</currentMemory>
5. start guest
# virsh start rhel72
error: Failed to start domain rhel72
error: unsupported configuration: initial memory size overflowed after alignment
6. test guest used a maxmemory which won't cause overflowed problem:
# virsh dumpxml rhel72-test |grep max
<maxMemory slots='16' unit='KiB'>9007199254739968</maxMemory>
# virsh start rhel72-test
Domain rhel72-test started
# service libvirtd restart
Redirecting to /bin/systemctl restart libvirtd.service
# virsh list --all
Id Name State
----------------------------------------------------
51 rhel72-test running
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.
https://rhn.redhat.com/errata/RHSA-2016-2577.html