Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1260576 - guest which use big maxmemory will lose track after restart libvirtd
guest which use big maxmemory will lose track after restart libvirtd
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.2
x86_64 Linux
low Severity low
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-07 05:49 EDT by Luyao Huang
Modified: 2016-11-03 14:23 EDT (History)
3 users (show)

See Also:
Fixed In Version: libvirt-1.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:23:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 08:07:06 EDT

  None (edit)
Description Luyao Huang 2015-09-07 05:49:58 EDT
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:
Comment 1 Peter Krempa 2015-12-04 09:29:45 EST
commit 645881139b3d2c86acf9d644c3a1471520bc9e57
Author: Peter Krempa <pkrempa@redhat.com>
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.
Comment 3 Luyao Huang 2016-06-01 05:40:47 EDT
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
Comment 5 errata-xmlrpc 2016-11-03 14:23:20 EDT
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

Note You need to log in before you can comment on or make changes to this bug.