Bug 853705 - virsh qemu-agent-command return 0 and without any error message when guest agent is not available
virsh qemu-agent-command return 0 and without any error message when guest ag...
Status: CLOSED DUPLICATE of bug 853673
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Libvirt Maintainers
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-02 05:27 EDT by Alex Jia
Modified: 2012-09-03 05:59 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-03 05:59:28 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)

  None (edit)
Description Alex Jia 2012-09-02 05:27:57 EDT
Description of problem:
virsh qemu-agent-command return 0 and without any error message when guest agent is not available.

Version-Release number of selected component (if applicable):

On the host:
# rpm -q libvirt qemu-kvm-rhev kernel
libvirt-0.10.1-1.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.302.el6.x86_64
kernel-2.6.32-288.el6.x86_64

On the guest:
# rpm -q qemu-guest-agent
qemu-guest-agent-0.12.1.2-2.302.el6.x86_64


How reproducible:
always

Steps to Reproduce:
1. to configure guest support GA
2. virsh start <domain>
3. login the guest then install qemu-guest-agent and start qemu-ga service
4. virsh qemu-agent-command <domain> '{"execute": "guest-info"}'
5. echo $? and check libvirtd.log  

Actual results:

# virsh qemu-agent-command foo '{"execute": "guest-info"}'

# echo $?
0

# cat /var/log//libvirt/libvirtd.log

<snip>

2012-09-02 09:10:49.522+0000: 31801: debug : qemuDispatchDomainAgentCommandHelper:19 : server=0x1155dc0 client=0x115eb40 msg=0x115f600 rerr=0x7f7b75188b80 args=0x7f7b64000f60 ret=0x7f7b64000f40
2012-09-02 09:10:49.522+0000: 31801: debug : virDomainQemuAgentCommand:217 : domain=0x7f7b640009a0, cmd={"execute": "guest-info"}, timeout=-1, flags=0
2012-09-02 09:10:49.522+0000: 31801: debug : qemuDomainObjBeginJobInternal:807 : Starting job: modify (async=none)
2012-09-02 09:10:49.522+0000: 31801: debug : virJSONValueFromString:975 : string={"execute": "guest-info"}
2012-09-02 09:10:49.522+0000: 31801: debug : virJSONParserHandleStartMap:852 : parser=0x7f7b75188980
2012-09-02 09:10:49.522+0000: 31801: debug : virJSONParserHandleMapKey:833 : parser=0x7f7b75188980 key=0x7f7b64000fa2
2012-09-02 09:10:49.522+0000: 31801: debug : virJSONParserHandleMapKey:833 : parser=0x7f7b75188980 key=0x7f7b64000fa2
2012-09-02 09:10:49.522+0000: 31801: debug : virJSONParserHandleString:813 : parser=0x7f7b75188980 str=0x7f7b64000fad
2012-09-02 09:10:49.522+0000: 31801: debug : virJSONParserHandleString:813 : parser=0x7f7b75188980 str=0x7f7b64000fad
2012-09-02 09:10:49.522+0000: 31801: debug : virJSONParserHandleEndMap:881 : parser=0x7f7b75188980
2012-09-02 09:10:49.522+0000: 31801: debug : virJSONParserHandleEndMap:881 : parser=0x7f7b75188980
2012-09-02 09:10:49.522+0000: 31801: debug : virJSONValueFromString:1019 : result=0x7f7b64001020
2012-09-02 09:10:49.522+0000: 31801: debug : virJSONValueFromString:1019 : result=0x7f7b64001020
2012-09-02 09:10:49.522+0000: 31801: debug : qemuAgentGuestSync:948 : Sending guest-sync command with ID: 1346577049522
2012-09-02 09:10:54.000+0000: 31801: error : qemuAgentSend:888 : Guest agent is not responding: Guest agent not available for now
2012-09-02 09:10:54.000+0000: 31801: debug : qemuAgentGuestSync:953 : qemuAgentSend returned: -2
2012-09-02 09:10:54.000+0000: 31801: debug : qemuAgentGuestSync:953 : qemuAgentSend returned: -2
2012-09-02 09:10:54.000+0000: 31801: error : qemuDomainAgentCommand:13904 : internal error Failed to execute agent command

</snip>


Expected results:

Libvirt should raise error message when guest agent is not available, and virsh 
qemu-agent-command should return 1.

Additional info:

# virsh dumpxml myRHEL6
<domain type='kvm' id='2'>
  ......
  <devices>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/myRHEL6.agent'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
  ......
  </devices>
  ......
</domain>
Comment 2 Jiri Denemark 2012-09-03 05:59:28 EDT
The action which doesn't fail while it should is different but the
cause for that is the same as in bug 853673.

*** This bug has been marked as a duplicate of bug 853673 ***

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