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 1437010 - use setvcpu command to cold unplug guest vcpu will make guest have broken settings
Summary: use setvcpu command to cold unplug guest vcpu will make guest have broken set...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.4
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: yalzhang@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-29 09:16 UTC by Luyao Huang
Modified: 2017-08-02 00:03 UTC (History)
5 users (show)

Fixed In Version: libvirt-3.2.0-2.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 17:24:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Description Luyao Huang 2017-03-29 09:16:13 UTC
Description of problem:
use setvcpu command to cold unplug guest vcpu will make guest have broken settings

Version-Release number of selected component (if applicable):
libvirt-3.1.0-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare a offline guest

# virsh dumpxml r7
...
  <vcpu placement='static' current='5'>10</vcpu>   <----no vcpus element
  <resource>
    <partition>/machine</partition>
  </resource>

...
  <cpu>
    <numa>
      <cell id='0' cpus='0-4' memory='524288' unit='KiB'/>
      <cell id='1' cpus='5-9' memory='524288' unit='KiB'/>
    </numa>
  </cpu>

2.
virsh setvcpu r7 2 --disable --config

3. restart libvirtd

# service libvirtd restart
Redirecting to /bin/systemctl restart  libvirtd.service

# virsh edit r7
error: failed to get domain 'r7'
error: Domain not found: no domain with matching name 'r7'


log:

libvirtd: 2017-03-29 09:14:51.019+0000: 7633: error : qemuDomainDefVcpusPostParse:2613 : unsupported configuration: online non-hotpluggable vcpus need to be ordered prior to hotplugable vcpus


Actual results:

guest disappear after restart libvirtd

Expected results:

guest still exist

Additional info:

Comment 1 Peter Krempa 2017-04-04 07:22:58 UTC
Fixed upstream by:

commit 079832103c3b7883e36db90705631cc55cac9dcc
Author: Peter Krempa <pkrempa>
Date:   Fri Mar 31 13:34:16 2017 +0200

    qemu: hotplug: Validate that vcpu-hotplug does not break config
    
    Make sure that non-hotpluggable vcpus stay clustered at the beginning
    after modifying persistent definition.

Comment 4 yalzhang@redhat.com 2017-05-10 12:43:03 UTC
Test on below packages:
libvirt-3.2.0-4.el7.x86_64
qemu-kvm-rhev-2.9.0-2.el7.x86_64

In step 2, the error message is $cpuid+1, but for cpu0, it is 0. Do you think it is expected? 

1. prepare a offline domain
# virsh dumpxml rhel7
...
  <vcpu placement='static' current='5'>10</vcpu>   <----no vcpus element
...

2. 
# virsh setvcpu rhel7 2 --disable --config
error: invalid argument: vcpu '3' can't be modified as it is followed by non-hotpluggable online vcpus

# virsh setvcpu rhel7 0 --disable
error: invalid argument: vCPU '0' must be enabled

# virsh setvcpu rhel7 11 --disable
error: invalid argument: vcpu 11 is not present in persistent config

# virsh dumpxml rhel7 | grep /vcpu 
  <vcpu placement='static' current='5'>10</vcpu>

# cat /var/log/libvirt/libvirtd.log  | grep error
2017-05-10 12:14:34.781+0000: 31726: error : qemuDomainVcpuValidateConfig:5909 : invalid argument: vcpu '3' can't be modified as it is followed by non-hotpluggable online vcpus

Comment 5 Peter Krempa 2017-05-12 15:50:41 UTC
Indeed, it prints the number of the vcpu following the modified vcpu.
I posted a patch:

https://www.redhat.com/archives/libvir-list/2017-May/msg00399.html

Comment 7 yalzhang@redhat.com 2017-05-24 00:24:17 UTC
Verify this bug, and the error message error will be tracked on bug 1451983.

Comment 8 errata-xmlrpc 2017-08-01 17:24:15 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-2017:1846

Comment 9 errata-xmlrpc 2017-08-02 00:03:43 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-2017:1846


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