Bug 1160559
Summary: | libvirt do a wrong check when try to use vcpupin --config to a running vm | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Luyao Huang <lhuang> |
Component: | libvirt | Assignee: | Pavel Hrdina <phrdina> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.1 | CC: | dyuan, mzhan, phrdina, pkrempa, rbalakri |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.17-3.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-19 05:55:08 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
2014-11-05 07:32:01 UTC
Proposed upstream patch: https://www.redhat.com/archives/libvir-list/2015-February/msg00801.html Upstream commit: commit 81dd81e475c475b536eba08417a48a1e5210a265 Author: Pavel Hrdina <phrdina> Date: Fri Feb 20 08:21:05 2015 +0100 virsh: fix vcpupin info The "virDomainGetInfo" will get for running domain only live info and for offline domain only config info. There was no way how to get config info for running domain. We will use "vshCPUCountCollect" instead to get the correct cpu count that we need to pass to "virDomainGetVcpuPinInfo". Also cleanup some unnecessary variables and checks that are done by drivers. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1160559 Signed-off-by: Pavel Hrdina <phrdina> Verify this issue with libvirt-1.2.16-1.el7.x86_64: S1: 1.prepare a vm with: <vcpu placement='static' current='2'>4</vcpu> 2.# virsh start test3 Domain test3 started 3.# virsh vcpupin test3 VCPU: CPU Affinity ---------------------------------- 0: 0-3 1: 0-3 4. # virsh setvcpus test3 3 --config 5.# virsh dumpxml test3 --inactive|grep cpu <vcpu placement='static' current='3'>4</vcpu> 6. # virsh vcpupin test3 --config VCPU: CPU Affinity ---------------------------------- 0: 0-3 1: 0-3 2: 0-3 7. # virsh vcpupin test3 2 --config VCPU: CPU Affinity ---------------------------------- 2: 0-3 # virsh vcpupin test3 2 1 --config # virsh vcpupin test3 2 --config VCPU: CPU Affinity ---------------------------------- 2: 1 S2: 1.prepare a vm with: <vcpu placement='static' current='2'>4</vcpu> 2.# virsh start test3 Domain test3 started 3.# virsh vcpupin test3 VCPU: CPU Affinity ---------------------------------- 0: 0-3 1: 0-3 4.hot-plug a vcpu: # virsh setvcpus test3 3 5.# virsh dumpxml test3 |grep cpu <vcpu placement='static' current='3'>4</vcpu> 6.# virsh dumpxml test3 --inactive |grep cpu <vcpu placement='static' current='2'>4</vcpu> 7. I still think this is not okay, we should output error in this step(i will send a patch to upstream): # virsh vcpupin test3 2 --config VCPU: CPU Affinity ---------------------------------- 8. # virsh vcpupin test3 2 1 --config error: invalid argument: vcpu 2 is out of range of persistent cpu count 2 Hi Pavel, We need a bz for the issue described in comment 5 S2 step 7, and patch: commit 848ab685f74afae102e265108518095942ecb293 Author: Luyao Huang <lhuang> Date: Mon Jun 29 10:10:15 2015 +0800 virsh: report error if vcpu number exceed the guest maxvcpu number Do you think it is okay to reopen this bug for this patch ? or we need open a new bz to track this ? Thanks in advance for your reply. Luyao (In reply to Luyao Huang from comment #6) > > commit 848ab685f74afae102e265108518095942ecb293 Note that after that commit the code is still incorrect as the condition that was added in the commit does not work as expected. Since VIR_DOMAIN_AFFECT_CURRENT is 0 the condition will not trigger if --live is not selected and thus will report "persistent" in the message even if the VM is online but no mode was selected. (In reply to Peter Krempa from comment #7) > (In reply to Luyao Huang from comment #6) > > > > commit 848ab685f74afae102e265108518095942ecb293 > > Note that after that commit the code is still incorrect as the condition > that was added in the commit does not work as expected. Since > VIR_DOMAIN_AFFECT_CURRENT is 0 the condition will not trigger if --live is > not selected and thus will report "persistent" in the message even if the VM > is online but no mode was selected. Oh, thanks a lot for your reply, i will write a new patch to fix it. Hi Luyao, You can reopen this bug to track that issue, because it's related to the original bug and to the patch fixing this bug. (In reply to Pavel Hrdina from comment #9) > Hi Luyao, > > You can reopen this bug to track that issue, because it's related to the > original bug and to the patch fixing this bug. Thanks a lot for your reply, reopen this bug. Verify the left issue with libvirt-1.2.17-9.el7.x86_64: 1. prepare a inactive guest: # virsh domstate test3 shut off 2. check the output error: # virsh vcpupin test3 --config VCPU: CPU Affinity ---------------------------------- 0: 0-2 1: 0-2 # virsh vcpupin test3 1 --config VCPU: CPU Affinity ---------------------------------- 1: 0-2 # virsh vcpupin test3 2 --config error: vcpu 2 is out of range of persistent cpu count 2 # virsh vcpupin test3 2 --current error: vcpu 2 is out of range of persistent cpu count 2 3. start the guest: # virsh start test3 Domain test3 started 4. check the output error # virsh vcpupin test3 --config VCPU: CPU Affinity ---------------------------------- 0: 0-2 1: 0-2 # virsh vcpupin test3 --live VCPU: CPU Affinity ---------------------------------- 0: 0-2 1: 0-2 # virsh vcpupin test3 2 --live error: vcpu 2 is out of range of live cpu count 2 # virsh vcpupin test3 2 --config error: vcpu 2 is out of range of persistent cpu count 2 # virsh vcpupin test3 2 --current error: vcpu 2 is out of range of live cpu count 2 # virsh vcpupin test3 2 3 error: invalid argument: vcpu 2 is out of range of live cpu count 2 # virsh vcpupin test3 2 3 --config error: invalid argument: vcpu 2 is out of range of persistent cpu count 2 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/RHBA-2015-2202.html |