Bug 853821

Summary: virsh reboot with 'agent' shutdown mode will hang
Product: Red Hat Enterprise Linux 6 Reporter: Alex Jia <ajia>
Component: libvirtAssignee: Jiri Denemark <jdenemar>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.4CC: acathrow, dyasny, dyuan, gsun, mfuruta, mzhan, rwu
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.10.2-0rc1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:22:56 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:
Attachments:
Description Flags
libvirtd.log none

Description Alex Jia 2012-09-03 03:53:21 UTC
Created attachment 609241 [details]
libvirtd.log

Description of problem:
virsh reboot with 'agent' shutdown mode will hang, in fact, the guest is successfully rebooted, but virsh command can't exit.

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

On the host:
# rpm -q libvirt qemu-kvm-rhev seabios kernel
libvirt-0.10.1-1.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.307.el6.x86_64
seabios-0.6.1.2-19.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.307.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 reboot --mode agent <domain>
  
Actual results:

The guest is successfully rebooted, but virsh reboot command can't exit.


Expected results:

virsh reboot command can normally exit after executing.

Additional info:

I can see {"execute":"guest-shutdown","arguments":{"mode":"reboot"}} in qemu-ga's log on the guest.

# 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 Alex Jia 2012-09-03 05:31:48 UTC
virsh reboot with 'agent' mode is successfull on libvirt-0.9.10-9.el6 and qemu-kvm-0.12.1.2-2.265.el6, and with qemu-guest-agent-0.12.1.2-2.265.el6 in the guest, please see https://bugzilla.redhat.com/show_bug.cgi?id=767333#c12, so it should be a regression bug.

Comment 4 Jiri Denemark 2012-09-03 12:02:12 UTC
*** Bug 853839 has been marked as a duplicate of this bug. ***

Comment 5 Jiri Denemark 2012-09-04 12:21:36 UTC
This is now fixed upstream by v0.10.1-15-g03c42a4:

commit 03c42a4510f3232cb85c673f7f02208d56169eca
Author: Jiri Denemark <jdenemar>
Date:   Tue Sep 4 12:01:43 2012 +0200

    qemu: Fix reboot with guest agent

    When reboot using qemu guest agent was requested, qemu driver kept
    waiting for SHUTDOWN event from qemu. However, such event is never
    emitted during guest reboot and qemu driver would keep waiting
    forever.

Comment 7 Wayne Sun 2012-09-19 07:29:23 UTC
pkgs:
# rpm -q libvirt qemu-kvm-rhev kernel seabios
libvirt-0.10.2-0rc1.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.313.el6.x86_64
kernel-2.6.32-279.el6.x86_64
seabios-0.6.1.2-19.el6.x86_64

In guest:
# rpm -q qemu-guest-agent
qemu-guest-agent-0.12.1.2-2.314.el6.x86_64

steps
1. prepare a domain with qemu ga support
# virsh dumpxml libvirt_test_api
...
    <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>
...

# virsh start libvirt_test_api

login guest and install qemu-guest-agent

2. reboot with agent mode
# virsh reboot --mode agent libvirt_test_api
Domain libvirt_test_api is being rebooted

Reboot success and virsh exited.

So, this is fixed.

Comment 8 errata-xmlrpc 2013-02-21 07:22:56 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.

http://rhn.redhat.com/errata/RHSA-2013-0276.html