Bug 1329819 - virsh nodecpumap --pretty shows wrong result on machine with many cores
Summary: virsh nodecpumap --pretty shows wrong result on machine with many cores
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: pre-dev-freeze
: 7.3
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-23 13:55 UTC by Hao Liu
Modified: 2016-11-03 18:43 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.3.4-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:43:44 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description Hao Liu 2016-04-23 13:55:43 UTC
Description of problem:
virsh nodecpumap --pretty shows wrong result on machine with many cores

Version-Release number of selected component (if applicable):
libvirt-1.3.3-2.el7.x86_64

How reproducible:


Steps to Reproduce:
On a machine with many CPU cores exists.

# virsh nodecpumap --pretty
CPUs present:   120
CPUs online:    120
CPU map:        0-119,192,196,199,258,262,264,267,269-270,272-273,276-278,284-286,290-291,293-294,296,301-302,304,307-310,314,316,318,320,322,325-326,331-334,338,340-342,802-803,805,807-809,813-814,816-818,821-822,825,828-829,831,833,836


Expected results:
CPU map:        0-119

Additional info:
In tools/virsh-host.c: cmdNodeCpuMap
        char *str = virBitmapDataToString(cpumap, cpunum);
The second argument cpunum is in bit, but virBitmapDataToString requires
len in bytes.

Comment 2 Peter Krempa 2016-04-25 11:33:49 UTC
Fixed upstream:

commit 3a703b8120d9f996840bd315b6f74c45a7e98aad
Author: Peter Krempa <pkrempa>
Date:   Mon Apr 25 10:38:01 2016 +0200

    virsh: host: Use bitmap size in bytes rather than bit count

Comment 4 Jingjing Shao 2016-08-20 02:20:56 UTC
verify this bug as below

# rpm -q libvirt
libvirt-2.0.0-4.el7.x86_64

# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                240
On-line CPU(s) list:   0-239
Thread(s) per core:    2
Core(s) per socket:    15
Socket(s):             8
NUMA node(s):          8
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 62
Model name:            Intel(R) Xeon(R) CPU E7-2890 v2 @ 2.80GHz
Stepping:              7
CPU MHz:               1237.687
BogoMIPS:              5600.56
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              38400K
NUMA node0 CPU(s):     0-14,120-134
NUMA node1 CPU(s):     15-29,135-149
NUMA node2 CPU(s):     30-44,150-164
NUMA node3 CPU(s):     45-59,165-179
NUMA node4 CPU(s):     60-74,180-194
NUMA node5 CPU(s):     75-89,195-209
NUMA node6 CPU(s):     90-104,210-224
NUMA node7 CPU(s):     105-119,225-239

# virsh nodecpumap --pretty
CPUs present:   240
CPUs online:    240
CPU map:        0-239

The result is as expected. so I change the status to verified

Comment 6 errata-xmlrpc 2016-11-03 18:43: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/RHSA-2016-2577.html


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