Bug 1451983
| Summary: | libvirt gives wrong info when try to hot-plug vcpu 0 for inactive guest | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Jingjing Shao <jishao> |
| Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
| Status: | CLOSED ERRATA | QA Contact: | yalzhang <yalzhang> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.4 | CC: | dyuan, lhuang, pkrempa, rbalakri, xuzhang, yalzhang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-3.7.0-1.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-04-10 10:44:33 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Additionally, the message even if it said 'vcpu 0' would be partially misleading. The number in the error message was corrected upstream:
commit ae3b82266d5d9c825f5c3639e2cea59d4060b5ff
Author: Peter Krempa <pkrempa>
Date: Fri May 12 17:46:31 2017 +0200
qemu: hotplug: print correct vcpu when validating hot(un)plug config
The error message would contain first vcpu id after the list of vcpus
selected for modification. To print the proper vcpu id remember the
first vcpu selected to be modified.
The issue with the issue being misleading is still present though.
As of upstream:
commit b183f17d76839587cbe411f4e12beca18d3ec702
Author: Peter Krempa <pkrempa>
Date: Wed Jun 28 10:42:49 2017 +0200
qemu: hotplug: Disallow modification of vcpu 0 in inactive config
vcpu 0 must be always enabled and non-hotpluggable, thus you can't
modify it using the vcpu hotplug APIs. Disallow it so that users can't
create invalid configurations.
vcpu 0 can't be modified, so the misleading message about vcpu 0 won't appear.
Test on libvirt-3.8.0-1.el7.x86_64, the result is as expected, set this bug to be verified. 1. vcpu0 can not be modified wether the vm is running or inactive, check bug 1459785#c4 2. test the order: start the vm, then check the vcpu0 will order from '1' # virsh dumpxml rhel7.4 | grep /vcpus -B10 <vcpu placement='static' current='1'>8</vcpu> <vcpus> <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/> <vcpu id='1' enabled='no' hotpluggable='yes'/> <vcpu id='2' enabled='no' hotpluggable='yes'/> <vcpu id='3' enabled='no' hotpluggable='yes'/> <vcpu id='4' enabled='no' hotpluggable='yes'/> <vcpu id='5' enabled='no' hotpluggable='yes'/> <vcpu id='6' enabled='no' hotpluggable='yes'/> <vcpu id='7' enabled='no' hotpluggable='yes'/> </vcpus> 3. vcpu3 will get if as '2' when enabled # virsh setvcpu rhel7.4 '2-3,^2' --enable # virsh dumpxml rhel7.4 | grep /vcpus -B10 <vcpu placement='static' current='2'>8</vcpu> <vcpus> <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/> <vcpu id='1' enabled='no' hotpluggable='yes'/> <vcpu id='2' enabled='no' hotpluggable='yes'/> <vcpu id='3' enabled='yes' hotpluggable='yes' order='2'/> <vcpu id='4' enabled='no' hotpluggable='yes'/> <vcpu id='5' enabled='no' hotpluggable='yes'/> <vcpu id='6' enabled='no' hotpluggable='yes'/> <vcpu id='7' enabled='no' hotpluggable='yes'/> </vcpus> 4. vcpu 1 is the 3rd cpu to be enabled and get order of '3' # virsh setvcpu rhel7.4 1 --enable # virsh dumpxml rhel7.4 | grep /vcpus -B10 <vcpu placement='static' current='3'>8</vcpu> <vcpus> <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/> <vcpu id='1' enabled='yes' hotpluggable='yes' order='3'/> <vcpu id='2' enabled='no' hotpluggable='yes'/> <vcpu id='3' enabled='yes' hotpluggable='yes' order='2'/> <vcpu id='4' enabled='no' hotpluggable='yes'/> <vcpu id='5' enabled='no' hotpluggable='yes'/> <vcpu id='6' enabled='no' hotpluggable='yes'/> <vcpu id='7' enabled='no' hotpluggable='yes'/> </vcpus> 5. Set the order 2 cpu as disable, the order will be re-ordered. # virsh setvcpu rhel7.4 3 --disable # virsh dumpxml rhel7.4 | grep /vcpus -B10 <vcpu placement='static' current='2'>8</vcpu> <vcpus> <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/> <vcpu id='1' enabled='yes' hotpluggable='yes' order='2'/> <vcpu id='2' enabled='no' hotpluggable='yes'/> <vcpu id='3' enabled='no' hotpluggable='yes'/> <vcpu id='4' enabled='no' hotpluggable='yes'/> <vcpu id='5' enabled='no' hotpluggable='yes'/> <vcpu id='6' enabled='no' hotpluggable='yes'/> <vcpu id='7' enabled='no' hotpluggable='yes'/> </vcpus> 6. # virsh setvcpu rhel7.4 '3-4' --enable error: Operation not supported: only one hotpluggable entity can be selected (for persistent config, it will return succeed. This is acceptable as the error message is clear.) 7. # virsh setvcpu rhel7.4 1 --enable error: invalid argument: vcpu '1' is already in requested state (for persistent config, it will return succeed. This is acceptable as the error message is clear.) 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://access.redhat.com/errata/RHEA-2018:0704 |
Description of problem: libvirt gives wrong info when try to hot-plug vcpu 0 for inactive guest Version-Release number of selected component (if applicable): libvirt-3.2.0-5.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. # virsh dumpxml r7.2 | grep vcpu -A7 <vcpu placement='static' current='4'>10</vcpu> <vcpus> <vcpu id='0' enabled='yes' hotpluggable='no'/> <vcpu id='1' enabled='yes' hotpluggable='no'/> <vcpu id='2' enabled='yes' hotpluggable='yes'/> <vcpu id='3' enabled='yes' hotpluggable='yes'/> <vcpu id='4' enabled='no' hotpluggable='yes'/> <vcpu id='5' enabled='no' hotpluggable='yes'/> <vcpu id='6' enabled='no' hotpluggable='yes'/> <vcpu id='7' enabled='no' hotpluggable='yes'/> <vcpu id='8' enabled='no' hotpluggable='yes'/> <vcpu id='9' enabled='no' hotpluggable='yes'/> </vcpus> 2. # virsh list --all Id Name State ---------------------------------------------------- - r7.2 shut off 3. # virsh setvcpu r7.2 0 --enable error: invalid argument: vcpu '1' can't be modified as it is followed by non-hotpluggable online vcpus Actual results: As the result in step3 Expected results: Should give some reasonable info about vcpu 0 Additional info: