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 817239 - dominfo outputs incorrectly for memory unit
Summary: dominfo outputs incorrectly for memory unit
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-28 08:24 UTC by Min Zhan
Modified: 2013-02-21 07:12 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.9.13-3.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 07:12:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 21:18:26 UTC

Description Min Zhan 2012-04-28 08:24:28 UTC
Description of problem:
dominfo outputs incorrectly for memory unit

Version-Release number of selected component (if applicable):
libvirt-0.9.10-14.el6

How reproducible:
Always

Steps to Reproduce:
# virsh dumpxml rhel63
...
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
...

# virsh dominfo rhel63
Id:             -
Name:           rhel63
UUID:           9078a4b7-f1b5-71a2-43dc-7e3e000bc0ce
OS Type:        hvm
State:          shut off
CPU(s):         1
Max memory:     1048576 kB -> the unit should be KiB or k
Used memory:    1048576 kB -> the unit should be KiB or k
Persistent:     yes
Autostart:      enable
Managed save:   no
Security model: selinux
Security DOI:   0

Actual results:
As above

Expected results:
Use k or KiB for memory unit


Additional info:

Comment 1 Min Zhan 2012-04-28 08:25:52 UTC
Also for the following memory unit:

# virsh nodeinfo
CPU model:           x86_64
CPU(s):              4
CPU frequency:       2659 MHz
CPU socket(s):       1
Core(s) per socket:  4
Thread(s) per core:  1
NUMA cell(s):        1
Memory size:         7994800 kB 

# virsh nodememstats
total  :              7994800 kB
free   :              5690124 kB
buffers:               251384 kB
cached :              1123096 kB

Comment 2 Eric Blake 2012-04-28 16:48:05 UTC
These should be trivial fixes to virsh.  I'll propose something upstream soon.

Comment 4 Eric Blake 2012-04-30 20:31:39 UTC
Upstream patch proposed
https://www.redhat.com/archives/libvir-list/2012-April/msg01535.html

Comment 5 Eric Blake 2012-05-23 17:48:33 UTC
Will be fixed for 6.4 when the rebase picks this up:

commit 706aa7c52bcedb9a1346e23ecb244b7291d06c53
Author: Eric Blake <eblake>
Date:   Mon Apr 30 14:27:56 2012 -0600

    virsh: output scaled values with correct units
    
    The recent push to use correct scaling terms (kB for 1000, KiB for
    1024 - such as commit 9dfdead) missed some places in virsh.
    
    * tools/virsh.c (prettyCapacity, cmdDominfo, cmdFreecell)
    (cmdNodeinfo, cmdNodeMemStats, cmdMigrateSetMaxSpeed)
    (cmdBlockCopy, cmdBlockPull, cmdBlockJob): Use KiB, not kB, when
    referring to multiples of 1024.
    * tests/virshtest.c: Update expected output to match.

Comment 8 EricLee 2012-07-25 02:04:11 UTC
Verified in libvirt-0.9.13-3.el6:

# virsh dumpxml qcow2_foo | grep -I mem
  <memory unit='KiB'>1048576</memory>
    <memballoon model='virtio'>
    </memballoon>

# virsh dominfo qcow2_foo
Id:             -
Name:           qcow2_foo
UUID:           8ac888e7-7288-bce9-0ef1-ce639d51c095
OS Type:        hvm
State:          shut off
CPU(s):         4
Max memory:     1048576 KiB
Used memory:    1048576 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: selinux
Security DOI:   0

# virsh nodeinfo
CPU model:           x86_64
CPU(s):              4
CPU frequency:       2000 MHz
CPU socket(s):       1
Core(s) per socket:  4
Thread(s) per core:  1
NUMA cell(s):        1
Memory size:         3791292 KiB

# virsh nodememstats
total  :              3791292 KiB
free   :              2727060 KiB
buffers:               110820 KiB
cached :               424992 KiB

And can reproduce in libvirt-0.9.10-21.el6:

# virsh dominfo qcow2_foo
Id:             -
Name:           qcow2_foo
UUID:           8ac888e7-7288-bce9-0ef1-ce639d51c095
OS Type:        hvm
State:          shut off
CPU(s):         4
Max memory:     1048576 kB
Used memory:    1048576 kB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: selinux
Security DOI:   0

# virsh nodeinfo
CPU model:           x86_64
CPU(s):              4
CPU frequency:       2000 MHz
CPU socket(s):       1
Core(s) per socket:  4
Thread(s) per core:  1
NUMA cell(s):        1
Memory size:         3791292 kB

# virsh nodememstats
total  :              3791292 kB
free   :              2735832 kB
buffers:               110888 kB
cached :               418464 kB

So setting to VERIFIED.

Comment 9 errata-xmlrpc 2013-02-21 07:12:32 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.

http://rhn.redhat.com/errata/RHSA-2013-0276.html


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