Bug 1240979 - error not correct when hot-plug/unplug a vcpu via agent to a offline domain
Summary: error not correct when hot-plug/unplug a vcpu via agent to a offline domain
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
low
low
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-08 09:34 UTC by Luyao Huang
Modified: 2015-11-19 06:48 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.2.17-2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 06:48:25 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Luyao Huang 2015-07-08 09:34:56 UTC
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@redhat.com>
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@redhat.com>
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>

Comment 4 hongming 2015-08-07 07:08:32 UTC
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

Comment 6 errata-xmlrpc 2015-11-19 06:48:25 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/RHBA-2015-2202.html


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