RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1451983 - libvirt gives wrong info when try to hot-plug vcpu 0 for inactive guest
Summary: libvirt gives wrong info when try to hot-plug vcpu 0 for inactive guest
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: yalzhang@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-18 05:53 UTC by Jingjing Shao
Modified: 2018-04-10 10:46 UTC (History)
6 users (show)

Fixed In Version: libvirt-3.7.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 10:44:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0704 0 None None None 2018-04-10 10:46:10 UTC

Description Jingjing Shao 2017-05-18 05:53:17 UTC
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:

Comment 2 Peter Krempa 2017-05-18 07:04:53 UTC
Additionally, the message even if it said 'vcpu 0' would be partially misleading.

Comment 3 Peter Krempa 2017-05-22 08:44:34 UTC
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.

Comment 4 Peter Krempa 2017-06-28 12:28:44 UTC
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.

Comment 6 yalzhang@redhat.com 2017-10-20 13:11:57 UTC
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.)

Comment 10 errata-xmlrpc 2018-04-10 10:44:33 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://access.redhat.com/errata/RHEA-2018:0704


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