Bug 1455284 - virsh nodecpumap shows wrong cpus present output
Summary: virsh nodecpumap shows wrong cpus present output
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: ppc64le
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-24 16:16 UTC by Satheesh Rajendran
Modified: 2017-05-30 08:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-30 08:43:53 UTC
Embargoed:


Attachments (Terms of Use)

Description Satheesh Rajendran 2017-05-24 16:16:24 UTC
Description of problem:
virsh nodecpumap ignores the last cores offline cpus and shows wrong value for cpus present and map field

Actual:
# virsh nodecpumap
CPUs present:   153
CPUs online:    20
CPU map:        y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y

Expected:
CPUs present:   160
CPUs online:    20
CPU map:        y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------

# lscpu
Architecture:          ppc64le
Byte Order:            Little Endian
CPU(s):                160
On-line CPU(s) list:   0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152
Off-line CPU(s) list:  1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79,81-87,89-95,97-103,105-111,113-119,121-127,129-135,137-143,145-151,153-159
Thread(s) per core:    1
Core(s) per socket:    5
Socket(s):             4
NUMA node(s):          4
Model:                 2.1 (pvr 004b 0201)
Model name:            POWER8E (raw), altivec supported
L1d cache:             64K
L1i cache:             32K
L2 cache:              512K
L3 cache:              8192K
NUMA node0 CPU(s):     0,8,16,24,32
NUMA node1 CPU(s):     40,48,56,64,72
NUMA node16 CPU(s):    80,88,96,104,112
NUMA node17 CPU(s):    120,128,136,144,152


Version-Release number of selected component (if applicable):
# virsh version
Compiled against library: libvirt 3.4.0
Using library: libvirt 3.4.0
Using API: QEMU 3.4.0
Running hypervisor: QEMU 2.9.50


How reproducible:
Always

Steps to Reproduce:
1.# virsh nodecpumap

Actual results:
CPUs present:   153
CPUs online:    20
CPU map:        y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y


Expected results:
CPUs present:   160
CPUs online:    20
CPU map:        y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------


Additional info:

Comment 1 Peter Krempa 2017-05-30 08:43:53 UTC
Fixed upstream:

commit 4ae0f65669a6672a408e08698678ed2958a77fde
Author: Nitesh Konkar <niteshkonkar.libvirt>
Date:   Thu May 25 15:47:43 2017 +0530

    util: hostcpu: Correctly report total number of vcpus in virHostCPUGetMap
    
    Callers expect the return value to be the total number of vcpus in the
    host (including offline vcpus). The refactor in c67e04e25fa58104e0fae41
    broke this assumption by using virHostCPUGetOnlineBitmap which only
    creates a bitmap long enough to hold the last online vcpu.
    
    Report the full number of host vcpus by returning value from
    virHostCPUGetCount().


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