Bug 1240979
| Summary: | error not correct when hot-plug/unplug a vcpu via agent to a offline domain | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Luyao Huang <lhuang> |
| Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 7.2 | CC: | dyuan, honzhang, mzhan, pkrempa, rbalakri |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.2.17-2.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-11-19 06:48:25 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: | |||
Verify it as follows. The result is expected. Move its status to VERIFIED.
# rpm -q libvirt
libvirt-1.2.17-3.el7.x86_64
# virsh destroy test4
Domain test4 destroyed
# virsh dumpxml test4
<channel type='unix'>
<source mode='bind' path='/var/lib/libvirt/qemu/test4.agent'/>
<target type='virtio' name='org.qemu.guest_agent.0'/>
<address type='virtio-serial' controller='0' bus='0' port='2'/>
</channel>
# virsh setvcpus test4 --guest 1
error: Requested operation is not valid: domain is not running
# virsh setvcpus test4 --guest 5
error: invalid argument: requested vcpus is greater than max allowable vcpus for the domain: 5 > 4
# virsh setvcpus test4 --guest 3
error: Requested operation is not valid: domain is not running
# virsh start test4
Domain test4 started
# virsh setvcpus test4 --guest 3
error: Guest agent is not responding: Guest agent not available for now
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 |
Description of problem: error not correct when hot-plug/unplug a vcpu via agent Version-Release number of selected component (if applicable): libvirt-1.2.17-1.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.prepare a offline guest with agent: # virsh dumpxml test3 ... <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/test3.agent'/> <target type='virtio' name='org.qemu.guest_agent.0'/> <address type='virtio-serial' controller='0' bus='0' port='8'/> </channel> ... 2. # virsh setvcpus test3 --guest 1 error: Guest agent is not responding: QEMU guest agent is not connected 3. Actual results: error in step 2 is not correct, guest is not running so the main issue is domain status is not correct Expected results: error should like this: error: Operation not supported: setting vcpus via guest agent isn't supported on offline domain or error: Requested operation is not valid: domain is not running Additional info: This seems a error message regression, test with libvirt-1.2.14: # virsh setvcpus test3 --guest 1 error: Operation not supported: setting vcpus via guest agent isn't supported on offline domain And upstream patch: commit 0b3fcfb1eac845ba24ac2ad6eefb969d5f7b8395 Author: Luyao Huang <lhuang> Date: Fri Jul 3 14:58:05 2015 +0800 qemu: move the guest status check before agent config and status check When use setvcpus command with --guest option to a offline vm, we will get error: # virsh setvcpus test3 1 --guest error: Guest agent is not responding: QEMU guest agent is not connected However guest is not running, agent status could not be connected. In this case, report domain is not running will be better than agent is not connected. Move the guest status check more early to output error to point out guest status is not right. Also from the logic, a running vm is a basic requirement to use agent, we cannot use agent if vm is not running. Signed-off-by: Luyao Huang <lhuang> Signed-off-by: Michal Privoznik <mprivozn>