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 1000357 - vcpu hotplug without <acpi> feature fail but vcpucount updated
Summary: vcpu hotplug without <acpi> feature fail but vcpucount updated
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.5
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1000354
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-23 09:28 UTC by Wayne Sun
Modified: 2014-10-14 04:16 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.10.2-32.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 1000354
Environment:
Last Closed: 2014-10-14 04:16:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1374 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2014-10-14 08:11:54 UTC

Description Wayne Sun 2013-08-23 09:28:37 UTC
This also exist on libvirt-0.10.2-23.el6.x86_64 with virsh setvcpus fail but xml/vcpucount is updated

# virsh setvcpus kvm-rhel6.4-x86_64-qcow2-ide 2
error: internal error got wrong number of vCPU pids from QEMU monitor. got 1, wanted 2

# echo $?
1

# virsh dumpxml kvm-rhel6.4-x86_64-qcow2-ide |grep vcpu
  <vcpu placement='static' current='2'>4</vcpu>

# virsh vcpucount kvm-rhel6.4-x86_64-qcow2-ide
maximum      config         4
maximum      live           4
current      config         1
current      live           2

# virsh vcpuinfo kvm-rhel6.4-x86_64-qcow2-ide
VCPU:           0
CPU:            50
State:          running
CPU time:       9.9s
CPU Affinity:   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

+++ This bug was initially created as a clone of Bug #1000354 +++

Description of problem:
Without <acpi> feature, virsh setvcpus not fail and xml/vcpucount/vcpuinfo updated.

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


How reproducible:
always

Steps to Reproduce:
1. edit domain
...
   <features>
     <apic/>
     <pae/>
   </features>
...
<vcpu current='1'>3</vcpu>
...

No <acpi> feature and current as 1.

2.  start domain

# virsh start rhel7
Domain rhel7 started

Login the guest and check

# cat /proc/cpuinfo|grep processor|wc -l
1


3. Hotplug the vcpu

# virsh setvcpus rhel7 2

# echo $?
0

# virsh dumpxml rhel7

...
   <vcpu placement='static' current='2'>4</vcpu>
...

# virsh vcpucount rhel7
maximum      config        32
maximum      live          32
current      config         1
current      live           2

# virsh vcpuinfo rhel7
VCPU:           0
CPU:            8
State:          running
CPU time:       12.9s
CPU Affinity:   yyyyyyyyyyyyyyyy

VCPU:           1
CPU:            12
State:          running
CPU Affinity:   yyyyyyyyyyyyyyyy


Login the guest and check

# cat /proc/cpuinfo|grep processor|wc -l
1


Actual results:
hotplug fail but vcpu info updated

Expected results:
xml not updated

Additional info:

Comment 2 Peter Krempa 2013-08-26 12:33:38 UTC
commit 761fc481365703b861429d73a341bde352ba8d41
Author: Peter Krempa <pkrempa>
Date:   Tue Jan 15 16:09:43 2013 +0100

    qemu: Don't update count of vCPUs if hot-unplug has failed

forgot to fix one more error path, thus the count is still updated in some cases of failure.

Comment 3 Peter Krempa 2013-08-26 13:14:14 UTC
Fixed upstream:

commit f17f164e3acefd590437da84cdcf08c63c7abb0b
Author: Peter Krempa <pkrempa>
Date:   Mon Aug 26 14:34:56 2013 +0200

    qemu: Don't update count of vCPUs if hot-plug fails silently
    
    When cpu hotplug fails without reporting an error, we would fail the
    command but update the count of vCPUs anyways.
    
    Commit 761fc481365703b861429d73a341bde352ba8d41 fixed the case when CPU
    hot-unplug failed silently, but forgot to fix up the value in this case.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1000357

Comment 10 Hu Jianwei 2014-04-14 08:28:59 UTC
I can reproduce it on libvirt-0.10.2-31.el6, but can not reproduce it on below version.

Version:
libvirt-0.10.2-32.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.423.el6.x86_64
kernel-2.6.32-456.el6.x86_64

Steps:
[root@intel-5205-32-2 ~]# virsh dumpxml r6 | grep features -A5
  <features>
    <apic/>
    <pae/>
  </features>
...

[root@intel-5205-32-2 ~]# virsh setvcpus r6 2
error: internal error got wrong number of vCPU pids from QEMU monitor. got 1, wanted 2

[root@intel-5205-32-2 ~]# echo $?
1
[root@intel-5205-32-2 ~]# virsh dumpxml r6| grep vcpu
  <vcpu placement='static' current='1'>4</vcpu>
[root@intel-5205-32-2 ~]# virsh vcpucount r6
maximum      config         4
maximum      live           4
current      config         1
current      live           1

[root@intel-5205-32-2 ~]# virsh vcpuinfo r6
VCPU:           0
CPU:            2
State:          running
CPU time:       34.5s
CPU Affinity:   yyyy

[In guest]:
[root@foo ~]# cat /proc/cpuinfo|grep processor|wc -l
1

We can get expected results, changed to verified.

Comment 12 errata-xmlrpc 2014-10-14 04:16:56 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.

http://rhn.redhat.com/errata/RHBA-2014-1374.html


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