Public bug reported: == Comment: #0 - Satheesh Rajendran <sathe...@in.ibm.com> - 2020-02-12 01:42:11 == ---Problem Description--- virsh nodecpustats --cpu <invalid cpu no> is not failing error
Contact Information = sathe...@in.ibm.com ---uname output--- 5.4.0-13-generic Machine Type = power9 ppc64le DD2.3 ---Debugger--- A debugger is not configured ---Steps to Reproduce--- 1. Execute virsh nodecpustats with a invalid cpu number, ideally it should fail with error msg rather it returns nothing and commands succeeds. # lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 160 On-line CPU(s) list: 0-159 Thread(s) per core: 4 Core(s) per socket: 20 Socket(s): 2 NUMA node(s): 2 Model: 2.3 (pvr 004e 1203) Model name: POWER9, altivec supported Frequency boost: enabled CPU max MHz: 3800.0000 CPU min MHz: 2300.0000 L1d cache: 1.3 MiB L1i cache: 1.3 MiB L2 cache: 10 MiB L3 cache: 200 MiB NUMA node0 CPU(s): 0-79 NUMA node8 CPU(s): 80-159 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Mitigation; RFI Flush, L1D private per thread Vulnerability Mds: Not affected Vulnerability Meltdown: Mitigation; RFI Flush, L1D private per thread Vulnerability Spec store bypass: Mitigation; Kernel entry/exit barrier (eieio) Vulnerability Spectre v1: Mitigation; __user pointer sanitization, ori31 speculation barrier enabled Vulnerability Spectre v2: Mitigation; Software count cache flush (hardware accelerated), Software link stack flush Vulnerability Tsx async abort: Not affected the system has total 160 cpus, any cpu number beyond should return error. Actual: # virsh nodecpustats --cpu 2000 # echo $? 0 Expected: # virsh nodecpustats --cpu 2000 error: Unable to get node cpu stats error: Invalid cpuNum in virHostCPUGetStatsLinux Userspace tool common name: ii libvirt0:ppc64el 6.0.0-0ubuntu2 ppc64el library for interfacing with different virtualization systems The userspace tool has the following bit modes: both Userspace rpm: ii libvirt0:ppc64el 6.0.0-0ubuntu2 ppc64el library for interfacing with different virtualization systems Userspace tool obtained from project website: na *Additional Instructions for sathe...@in.ibm.com: -Post a private note with access information to the machine that the bug is occuring on. -Attach ltrace and strace of userspace application. == Comment: #3 - Satheesh Rajendran <sathe...@in.ibm.com> - 2020-02-12 04:07:48 == == Comment: #8 - Mauro Rodrigues <maur...@br.ibm.com> - 2020-02-14 06:54:20 == == Comment: #9 - Mauro Rodrigues <maur...@br.ibm.com> - 2020-02-14 06:55:38 == It does happen upstream. Seeteena would you please test the attached patch? Thing is that, even though virHostCPUGetStatsLinux was logging the invalid cpuNum error, it wasn't returning a failure (see the message below), so the upper layers correctly couldn't report as such. 2020-02-14 12:44:03.524+0000: 46611: error : virHostCPUGetStatsLinux:833 : Invalid cpuNum in virHostCPUGetStatsLinux Another thing that bothers me, but considere I'm new to libvirt/qemu/kvm so it might just be my own incorrect understanding of it, is the fact that when we use "LIBVIRT_DEBUG=1 virsh cmd" we are just logging the command, not libvirt (ie libvirtd) execution.. The above message could be seen in libvirtd logs, but not from the command execution with LIBVIRT_DEBUG=1. So for me it's a bit misleading, but again it might just be my own mistake understanding this. I recommend to always attach libvirtd logs as well in future issues. == Comment: #13 - Mauro Rodrigues <maur...@br.ibm.com> - 2020-02-25 06:50:24 == FYI The patch, including a unit test, was sent to the libvirt mail list last friday. No feedback so far, unfortunately (which I think is fairly usual at libvirt ml). https://www.redhat.com/archives/libvir-list/2020-February/msg00757.html ... which reads: "util: virhostcpu: Fail when fetching CPU Stats for invalid cpu" ** Affects: libvirt (Ubuntu) Importance: Undecided Assignee: Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) Status: New ** Tags: architecture-ppc64le bugnameltc-183869 severity-high targetmilestone-inin--- ** Tags added: architecture-ppc64le bugnameltc-183869 severity-high targetmilestone-inin--- -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1868528 Title: [libvirt] virsh nodecpustats --cpu <invalid cpu no> is not failing error To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1868528/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs