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 1308317 - libvirt check the wrong cpu placement status when change the emulator/iothreadpin configuration
Summary: libvirt check the wrong cpu placement status when change the emulator/iothrea...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-14 07:58 UTC by Luyao Huang
Modified: 2016-11-03 18:38 UTC (History)
1 user (show)

Fixed In Version: libvirt-1.3.3-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:38:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description Luyao Huang 2016-02-14 07:58:56 UTC
Description of problem:
libvirt check the wrong cpu placement status when change the emulator/iothreadpin configuration

Version-Release number of selected component (if applicable):
libvirt-1.2.17-13.el7_2.3.x86_64

How reproducible:
100%

Steps to Reproduce:
1.prepare a guest which cpu placement is auto:

# virsh dumpxml r7
...
  <vcpu placement='auto' current='1'>4</vcpu>
...

2. start it:

# virsh start r7
Domain r7 started


3. edit the inactive guest xml and change vcpu placement to static:
# virsh edit r7

  <vcpu placement='static' current='1'>4</vcpu>

Domain r7 XML configuration edited.

4. we will get failure when use iothreadpin/emulatorpin with --config:

# virsh emulatorpin r7 1 --config
error: Requested operation is not valid: Changing affinity for emulator thread dynamically is not allowed when CPU placement is 'auto'

# virsh iothreadpin r7 1 1 --config
error: Requested operation is not valid: Changing affinity for IOThread dynamically is not allowed when CPU placement is 'auto'

Actual results:
libvirt check the wrong vcpu placement status when change the emulator/iothreadpin configuration for a running guest

Expected results:

command return success on step 4

Additional info:

Comment 1 Peter Krempa 2016-03-01 09:48:57 UTC
Fixed upstream:

commit d1277de226a4f840df0c20a9931a2c009b505d25
Author: Peter Krempa <pkrempa>
Date:   Wed Feb 24 14:40:51 2016 +0100

    qemu: Allow setting pinning of emulator/iohtread with automatic placement
    
    We honour the placement bitmaps when starting up, so there's no point in
    having this check. Additionally the check was buggy since it checked
    vm->def all the time even if the user requested to modify the persistent
    definition which had different configuration.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1308317

v1.3.2-4-gd1277de

Comment 2 Mike McCune 2016-03-28 23:19:36 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 4 Luyao Huang 2016-08-09 02:27:02 UTC
Verify this bug with libvirt-2.0.0-4.el7.x86_64:

1. prepare a guest with auto placement vcpu element

# virsh dumpxml r7
..
  <vcpu placement='auto' current='6'>10</vcpu>
  <numatune>
    <memory mode='strict' placement='auto'/>
  </numatune>
..

2. start guest

# virsh start r7
Domain r7 started

3. check iothread, vcpupin, emulatorpin:

# virsh vcpupin r7
VCPU: CPU Affinity
----------------------------------
   0: 0,2,4,6,8,10,12,14,16,18,20,22
   1: 0,2,4,6,8,10,12,14,16,18,20,22
   2: 0,2,4,6,8,10,12,14,16,18,20,22
   3: 0,2,4,6,8,10,12,14,16,18,20,22
   4: 0,2,4,6,8,10,12,14,16,18,20,22
   5: 0,2,4,6,8,10,12,14,16,18,20,22
   6: 0,2,4,6,8,10,12,14,16,18,20,22
   7: 0,2,4,6,8,10,12,14,16,18,20,22
   8: 0,2,4,6,8,10,12,14,16,18,20,22
   9: 0,2,4,6,8,10,12,14,16,18,20,22

# virsh emulatorpin r7
emulator: CPU Affinity
----------------------------------
       *: 0,2,4,6,8,10,12,14,16,18,20,22

# virsh iothreadinfo r7
 IOThread ID     CPU Affinity   
---------------------------------------------------
 1               0,2,4,6,8,10,12,14,16,18,20,22

4. live change the bind:

# virsh vcpupin r7 0 1-10

# virsh vcpupin r7
VCPU: CPU Affinity
----------------------------------
   0: 1-10
   1: 0,2,4,6,8,10,12,14,16,18,20,22
   2: 0,2,4,6,8,10,12,14,16,18,20,22
   3: 0,2,4,6,8,10,12,14,16,18,20,22
   4: 0,2,4,6,8,10,12,14,16,18,20,22
   5: 0,2,4,6,8,10,12,14,16,18,20,22
   6: 0,2,4,6,8,10,12,14,16,18,20,22
   7: 0,2,4,6,8,10,12,14,16,18,20,22
   8: 0,2,4,6,8,10,12,14,16,18,20,22
   9: 0,2,4,6,8,10,12,14,16,18,20,22

# virsh emulatorpin r7
emulator: CPU Affinity
----------------------------------
       *: 0,2,4,6,8,10,12,14,16,18,20,22

# virsh emulatorpin r7 0-23

# virsh emulatorpin r7
emulator: CPU Affinity
----------------------------------
       *: 0-23

# virsh iothreadpin r7 1 1

# virsh iothreadinfo r7
 IOThread ID     CPU Affinity   
---------------------------------------------------
 1               1


5. change config for a running guest:

# virsh emulatorpin r7 20 --config

# virsh emulatorpin r7 --config
emulator: CPU Affinity
----------------------------------
       *: 20

# virsh vcpupin r7 1 0 --config 

# virsh vcpupin r7 1 --config 
VCPU: CPU Affinity
----------------------------------
   1: 0

# virsh iothreadpin r7 1 0 --config

# virsh iothreadinfo r7 --config
 IOThread ID     CPU Affinity   
---------------------------------------------------
 1               0

Comment 6 errata-xmlrpc 2016-11-03 18:38:26 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://rhn.redhat.com/errata/RHSA-2016-2577.html


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