Red Hat Bugzilla – Bug 1308317
libvirt check the wrong cpu placement status when change the emulator/iothreadpin configuration
Last modified: 2016-11-03 14:38:26 EDT
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:
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
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
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
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