Bug 1308317 - libvirt check the wrong cpu placement status when change the emulator/iothreadpin configuration
libvirt check the wrong cpu placement status when change the emulator/iothrea...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.2
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-14 02:58 EST by Luyao Huang
Modified: 2016-11-03 14:38 EDT (History)
1 user (show)

See Also:
Fixed In Version: libvirt-1.3.3-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:38:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 08:07:06 EDT

  None (edit)
Description Luyao Huang 2016-02-14 02:58:56 EST
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 04:48:57 EST
Fixed upstream:

commit d1277de226a4f840df0c20a9931a2c009b505d25
Author: Peter Krempa <pkrempa@redhat.com>
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 19:19:36 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 4 Luyao Huang 2016-08-08 22:27:02 EDT
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 14:38:26 EDT
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.