Bug 845966 - libvirt pmsuspend to disk will crash libvirtd
libvirt pmsuspend to disk will crash libvirtd
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
x86_64 Linux
high Severity high
: rc
: ---
Assigned To: Alex Jia
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2012-08-06 06:16 EDT by Huang Wenlong
Modified: 2013-10-20 17:45 EDT (History)
10 users (show)

See Also:
Fixed In Version: libvirt-0.10.2-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-02-21 02:21:12 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
gdb log (8.46 KB, text/plain)
2012-08-06 06:16 EDT, Huang Wenlong
no flags Details
libvirtd log (65.65 KB, text/plain)
2012-08-06 06:17 EDT, Huang Wenlong
no flags Details

  None (edit)
Description Huang Wenlong 2012-08-06 06:16:01 EDT
Description of problem:
libvirt pmsuspend to disk will crash libvirtd

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

How reproducible:

Steps to Reproduce:
1. install qemu-ga in the domain [qemu-guest-agent]   and  add xml into domain

<channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/rhelx86_64.agent'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>

2. start domain   and login domain , run qemu-ga -d  in the domain
#qemu-ga -d

3.in the host  run pmsuspend disk
#virsh dompmsuspend $domain disk

libvirtd crash

Actual results:
as steps

Expected results:
libvirtd do not crash

Additional info:
Comment 1 Huang Wenlong 2012-08-06 06:16:41 EDT
Created attachment 602475 [details]
gdb log
Comment 2 Huang Wenlong 2012-08-06 06:17:14 EDT
Created attachment 602476 [details]
libvirtd log
Comment 4 Alex Jia 2012-08-06 06:53:23 EDT
What's the qemu-guest-agent version in the guest? and seabios version on the host?

It's very strange for me, I can't reproduce it on my RHEL6.2(2.6.32-220.el6.x86_64) with libvirt-0.10.0-0rc0.el6.x86_64, qemu-kvm-rhev- and seabios-, and I installed qemu-guest-agent- in RHEL6 guest.

# virsh dumpxml myRHEL6


    <type arch='x86_64' machine='rhel6.3.0'>hvm</type>
    <boot dev='hd'/>


    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/myRHEL6.agent'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>


However, I also can reproduce the issue on Wenlong test machine even though I don't need to start qemu-ga in the guest.
Comment 5 Alex Jia 2012-08-06 06:55:47 EDT
(In reply to comment #4)
> What's the qemu-guest-agent version in the guest? and seabios version on the
> host?
I just check Wenlong machine:

On the guest:


On the host:

Comment 6 Alex Jia 2012-08-06 07:06:54 EDT
I checked it further, it's relationship with qemu-guest-agent version, and I can reproduce it on qemu-guest-agent- and qemu-guest-agent-, it may be qemu-guest-agent changes some places, however, libvirt hasn't follow it.
Comment 7 Alex Jia 2012-08-07 03:23:08 EDT
Path for upstream and wait for developers review:
Comment 8 Alex Jia 2012-08-08 02:25:35 EDT
Daniel's commit b57ee09 potentially fix the issue via using virObjectUnref() instead of qemuAgentUnref(), the old qemuAgentUnref(priv->agent) hasn't judge whether its parameter is NULL then will deref a NULL pointer, however, if the parameter 'priv->agent' is NULL then the virObjectUnref(priv->agent) will directly return false without executing subsequent codes.

commit b57ee0921ec7c5c2cfc51ce34fcc296aaad52dd5
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Wed Jul 11 14:35:47 2012 +0100

    Turn qemuAgentPtr and qemuMonitorPtr into virObjectPtr instances
    Make qemuAgentPtr and qemuMonitorPtr types use the virObject APIs
    for reference counting
    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Comment 11 Huang Wenlong 2012-10-12 01:38:46 EDT
Verify this bug with :

add these pattern in the xml 

    <type arch='x86_64' machine='rhel6.4.0'>hvm</type>
    <boot dev='hd'/>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='yes'/>

   <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/rhel6-dvs.agent'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>


#virsh dompmsuspend rhel6-dvs disk
Domain rhel6-dvs successfully suspended

#virsh start rhel6-dvs 

guest is fine
Comment 12 zhenfeng wang 2012-12-25 03:15:25 EST
Now, in pkg qemu-guest-agent-win32-  we can do the s3/s4 in windows guest based the windows guest agent supported commands list
supported commands:
"guest-shutdown" (include shutdown,reboot,halt)
Since there was a bug 888716 over there ,so the command "guest-susend-disk " did not work well so far
Comment 13 errata-xmlrpc 2013-02-21 02:21:12 EST
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.


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