Red Hat Bugzilla – Bug 817239
dominfo outputs incorrectly for memory unit
Last modified: 2013-02-21 02:12:32 EST
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:
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
These should be trivial fixes to virsh. I'll propose something upstream soon.
Upstream patch proposed https://www.redhat.com/archives/libvir-list/2012-April/msg01535.html
Will be fixed for 6.4 when the rebase picks this up: commit 706aa7c52bcedb9a1346e23ecb244b7291d06c53 Author: Eric Blake <eblake@redhat.com> 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.
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.
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