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.
Bug 1140958 - check the value of memory statistic period in xml
Summary: check the value of memory statistic period in xml
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Erik Skultety
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-12 06:31 UTC by Jincheng Miao
Modified: 2015-11-19 05:46 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.2.14-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 05:46:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Jincheng Miao 2014-09-12 06:31:37 UTC
Description of problem:
virsh command dommemstat forbids converting a large integer to signed one,
but this rule is not applied for configuration xml. The user could still set such
large value to virtio memballoon statistic period.
So libvirtd should check this value in xml.

Version-Release number of selected component (if applicable):
libvirt-1.2.8-1.el7.x86_64
qemu-kvm-rhev-2.1.0-3.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. configure guest with virtio memballoon statistic period '4294967295' (known as (int)-1):
# virsh dumpxml r7a | grep -1 memballoon
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
      <stats period='4294967295'/>
    </memballoon>
  </devices>

2. start guest
# virsh start r7a
Domain r7a started

the qmp event reports the error of this statistic period:
4865.707 > 0x7fd9f80077d0 {"execute":"qom-set","arguments":{"path":"//machine/i440fx/pci.0/child[9]","property":"guest-stats-polling-interval","value":-1},"id":"libvirt-88"}
4865.708 < 0x7fd9f80077d0 {"id": "libvirt-88", "error": {"class": "GenericError", "desc": "timer value must be greater than zero"}}

Expect result:
Don't convert '4294967295' to -1, or forbid user to set this value to '4294967295'.

Comment 2 Erik Skultety 2014-10-08 13:05:21 UTC
Fixed upstream:

commit e3a7b8740fb4be15d9ba4f49f65bb9ee743730a0
Author: Erik Skultety <eskultet>
Date:   Thu Oct 2 14:48:02 2014 +0200

    qemu: Fix updating balloon period in live XML
    
    Up until now, we set memballoon period in monitor successfully, however
    we did not update domain definition structure, thus dumpxml was omitting
    period attribute in memballoon element

v1.2.9-12-ge3a7b87

Comment 3 Erik Skultety 2014-10-10 11:46:25 UTC
EDIT: The commit I posted above is a related to a different issue (I'm sorry for my mistake), therefore this bug still needs to be considered as unfixed!!!

Comment 5 Luyao Huang 2015-03-13 09:19:52 UTC
Post a patch to upstream wait review:

http://www.redhat.com/archives/libvir-list/2015-March/msg00665.html

Comment 7 Erik Skultety 2015-03-24 11:31:31 UTC
commit ad69e8be4a7592c68174a7c0d8b07a2c392ea336
Author: Martin Kletzander <mkletzan>
Date:   Fri Mar 13 17:08:15 2015 +0100

    conf: Use correct type for balloon stats period
    
    We're parsing memballoon status period as unsigned int, but when we're
    trying to set it, both we and qemu use signed int.  That means large
    values will get wrapped around to negative one resulting in error.
    Basically the same problem as commit e3a7b874 was dealing with when
    updating live domain.
    
    QEMU changed the accepted value to int64 in commit 1f9296b5, but even
    values as INT_MAX don't make sense since the value passed means seconds.
    Hence adding capability flag for this change isn't worth it.

v1.2.13-203-gad69e8b

Comment 10 Luyao Huang 2015-07-22 02:04:55 UTC
Verify this bug in libvirt-1.2.17-2.el7.x86_64:

1. edit a guest and add period [2147483648, 4294967295] in memory balloon:

# virsh edit test4

    <memballoon model='virtio'>
      <stats period='4294967295'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0f' function='0x0'/>
    </memballoon>

2. recheck the xml:

# virsh dumpxml test4 --inactive |grep period

3.test update libvirt from libvirt-1.2.13-1.el7.x86_64 to libvirt-1.2.17-2.el7.x86_64 with a invalid period:

# virsh dumpxml test4 --inactive |grep period
      <stats period='4294967295'/>

# yum update /mnt/rhel7/libvirt/1.2.17-2.el7/libvirt-* /mnt/rhel7/libvirt-python/1.2.17-1.el7/libvirt-python-*

# virsh dumpxml test4 --inactive |grep period

Comment 12 errata-xmlrpc 2015-11-19 05:46:44 UTC
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/RHBA-2015-2202.html


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