Bug 1375939

Summary: libvirt setvcpus doesn't work well with old qemu
Product: Red Hat Enterprise Linux 7 Reporter: Luyao Huang <lhuang>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Jingjing Shao <jishao>
Severity: low Docs Contact:
Priority: low    
Version: 7.3CC: dyuan, jdenemar, pkrempa, rbalakri, weizhan, xuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-2.5.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 17:16:43 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:

Description Luyao Huang 2016-09-14 09:44:22 UTC
Description of problem:
libvirt setvcpus cannot work well with old qemu

Version-Release number of selected component (if applicable):
libvirt-2.0.0-8.el7.x86_64
qemu-kvm-1.5.3-124.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
S1: start a guest with hotpluggable vcpu:
1.
# virsh dumpxml r7-old
...
  <vcpu placement='static' current='4'>10</vcpu>
  <vcpus>
    <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/>
    <vcpu id='1' enabled='yes' hotpluggable='yes' order='4'/>
    <vcpu id='2' enabled='no' hotpluggable='yes'/>
    <vcpu id='3' enabled='no' hotpluggable='yes'/>
    <vcpu id='4' enabled='yes' hotpluggable='yes' order='3'/>
    <vcpu id='5' enabled='no' hotpluggable='yes'/>
    <vcpu id='6' enabled='yes' hotpluggable='yes' order='2'/>
    <vcpu id='7' enabled='no' hotpluggable='yes'/>
    <vcpu id='8' enabled='no' hotpluggable='yes'/>
    <vcpu id='9' enabled='no' hotpluggable='yes'/>
  </vcpus>
...

2.
# virsh start r7-old
error: Failed to start domain r7-old
error: unsupported configuration: vcpu '1' is missing hotplug data

S2: use setvcpus --config without new hotpluggable vcpu

1. 

# virsh dumpxml r7-old
...
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static' current='4'>10</vcpu>
  <cputune>
...

2,
# virsh setvcpus r7-old 5 --config

3. start guest:

# virsh start r7-old
error: Failed to start domain r7-old
error: unsupported configuration: vcpu '4' is missing hotplug data

4. try it again:
# virsh start r7-old
Domain r7-old started


Actual results:

libvirt setvcpus cannot work well with old qemu

Expected results:

S1: report a more clearly unsupport error

S2: can start guest at the first time

Additional info:

Comment 1 Peter Krempa 2016-09-30 10:55:43 UTC
commit 80ea1cf6be4ab916fc7e2f8bb2a93d5337b272ac
Author: Peter Krempa <pkrempa>
Date:   Wed Sep 21 07:46:25 2016 +0200

    qemu: Fix coldplug of vcpus
    
    virDomainDefSetVcpus was not designed to handle coldplug of vcpus now
    that we can set state of vcpus individually.
    
    Introduce qemuDomainSetVcpusConfig that properly handles state changes
    of vcpus when coldplugging so that invalid configurations are not
    created.

Comment 3 Jingjing Shao 2016-12-26 10:06:01 UTC
Hi Peter,

I try to verify this issue, but get the result as below. The S1 is not fixed.
Won't it be fixed ?


The S1 is not fixed
# virsh start rhel7.3
error: Failed to start domain rhel7.3
error: unsupported configuration: vcpu '1' is missing hotplug data



The S2 is fixed.

# virsh dumpxml rhel7.3
....
 <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static' current='4'>10</vcpu>
....

# virsh setvcpus rhel7.3  5 --config


# virsh start rhel7.3
Domain rhel7.3 started

Comment 4 Peter Krempa 2017-01-03 09:33:39 UTC
That obviously can't be fixed. The 'S1' configuration requires new hotplug approach so that it can work properly, thus it's rejected by libvirt.

Comment 5 Jingjing Shao 2017-01-04 03:19:11 UTC
(In reply to Peter Krempa from comment #4)
> That obviously can't be fixed. The 'S1' configuration requires new hotplug
> approach so that it can work properly, thus it's rejected by libvirt.

Thanks for Peter's reply,according to the comment#3 and #4 ,change the bug status to verified

Comment 6 errata-xmlrpc 2017-08-01 17:16: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

Comment 7 errata-xmlrpc 2017-08-01 23:57:38 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