[libvirt] virsh nodecpustats --cpu <invalid cpu no> is not failing error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
The Ubuntu-power-systems project |
Fix Released
|
High
|
Canonical Server | ||
libvirt (Ubuntu) |
Fix Released
|
High
|
Ubuntu on IBM Power Systems Bug Triage |
Bug Description
== Comment: #0 - Satheesh Rajendran <email address hidden> - 2020-02-12 01:42:11 ==
---Problem Description---
virsh nodecpustats --cpu <invalid cpu no> is not failing error
Contact Information = <email address hidden>
---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 virHostCPUGetSt
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 <email address hidden>:
-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 <email address hidden> - 2020-02-12 04:07:48 ==
== Comment: #8 - Mauro Rodrigues <email address hidden> - 2020-02-14 06:54:20 ==
== Comment: #9 - Mauro Rodrigues <email address hidden> - 2020-02-14 06:55:38 ==
It does happen upstream. Seeteena would you please test the attached patch?
Thing is that, even though virHostCPUGetSt
2020-02-14 12:44:03.524+0000: 46611: error : virHostCPUGetSt
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 <email address hidden> - 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:/
... which reads:
"util: virhostcpu: Fail when fetching CPU Stats for invalid cpu"
Related branches
- Rafael David Tinoco (community): Approve
- Canonical Server: Pending requested
- Canonical Server packageset reviewers: Pending requested
-
Diff: 5704 lines (+5514/-0)31 files modifieddebian/changelog (+13/-0)
debian/patches/series (+29/-0)
debian/patches/stable/lp-1868539-bhyve-command-remove-unused-includes.patch (+41/-0)
debian/patches/stable/lp-1868539-daemon-set-default-memlock-limit-for-systemd-service.patch (+94/-0)
debian/patches/stable/lp-1868539-m4-libxl-properly-fail-when-libxl-is-required.patch (+47/-0)
debian/patches/stable/lp-1868539-qemu-Don-t-compare-local-and-remote-hostnames-on-mig.patch (+62/-0)
debian/patches/stable/lp-1868539-qemu-Stop-domain-on-failed-restore.patch (+104/-0)
debian/patches/stable/lp-1868539-qemu-Use-g_autoptr-for-qemuDomainSaveCookie.patch (+140/-0)
debian/patches/stable/lp-1868539-qemu-do-not-revert-to-NULL-bandwidth.patch (+45/-0)
debian/patches/stable/lp-1868539-qemu-preserve-error-on-bandwidth-rollback.patch (+59/-0)
debian/patches/stable/lp-1868539-qemu-save-restore-original-error-when-recovering-fro.patch (+60/-0)
debian/patches/stable/lp-1868539-qemu-use-correct-backendType-when-checking-memfd-cap.patch (+46/-0)
debian/patches/stable/lp-1868539-qemuDomainGetStatsIOThread-Don-t-leak-array-with-0-i.patch (+49/-0)
debian/patches/stable/lp-1868539-qemuDomainSaveImageStartVM-Use-VIR_AUTOCLOSE-for-int.patch (+50/-0)
debian/patches/stable/lp-1868539-qemuDomainSaveImageStartVM-Use-g_autoptr-for-virComm.patch (+40/-0)
debian/patches/stable/lp-1868539-qemuTestParseCapabilitiesArch-Free-binary.patch (+52/-0)
debian/patches/stable/lp-1868539-security-Try-harder-to-run-transactions.patch (+97/-0)
debian/patches/stable/lp-1868539-tests-fix-double-unlock-of-monitor-in-hotplug-test.patch (+64/-0)
debian/patches/stable/lp-1868539-testutils-check-return-value-of-g_setenv.patch (+39/-0)
debian/patches/stable/lp-1868539-testutilsxen-error-out-on-initialization-failure.patch (+42/-0)
debian/patches/stable/lp-1868539-virDomainFSDefFree-Unref-private-data.patch (+52/-0)
debian/patches/stable/lp-1868539-virsystemdtest-do-not-leak-socket-path.patch (+55/-0)
debian/patches/stable/lp-1868539-vz-Fix-return-value-in-error-path.patch (+49/-0)
debian/patches/ubuntu/lp-1853200-cpu_map-Add-decode-element-to-x86-CPU-model-definiti.patch (+741/-0)
debian/patches/ubuntu/lp-1853200-cpu_map-Add-more-noTSX-x86-CPU-models.patch (+695/-0)
debian/patches/ubuntu/lp-1853200-cpu_map-Don-t-use-new-noTSX-models-for-host-model-CP.patch (+129/-0)
debian/patches/ubuntu/lp-1853200-cpu_x86-Honor-CPU-models-decode-element.patch (+59/-0)
debian/patches/ubuntu/lp-1853200-cputest-Add-data-for-Intel-R-Core-TM-i7-8550U-CPU-wi.patch (+2022/-0)
debian/patches/ubuntu/lp-1867460-qemu-fixing-auto-detecting-binary-in-domain-capabili.patch (+115/-0)
debian/patches/ubuntu/lp-1867460-qemu_capabilities-Rework-domain-caps-cache.patch (+325/-0)
debian/patches/ubuntu/lp-1868528-util-virhostcpu-Fail-when-fetching-CPU-Stats-for-inv.patch (+99/-0)
Changed in ubuntu-power-systems: | |
status: | New → Triaged |
assignee: | nobody → Canonical Server Team (canonical-server) |
importance: | Undecided → High |
Changed in ubuntu-power-systems: | |
status: | Triaged → Fix Committed |
Changed in ubuntu-power-systems: | |
status: | Fix Committed → Fix Released |
Default Comment by Bridge