Bug 839661

Summary: libvirt: support QMP event for S4
Product: Red Hat Enterprise Linux 6 Reporter: Luiz Capitulino <lcapitulino>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4CC: acathrow, ajia, areis, bsarathy, dallan, dyasny, dyuan, honzhang, lcapitulino, mzhan, rwu, weizhan, whuang, ydu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.10.2-4.el6 Doc Type: Bug Fix
Doc Text:
Cause: S4 event was not supported by libvirt on QEMU domains. Consequence: Management applications couldn't know whether guest was suspended to disk or powered off. Fix: Support for S4 event was added. Result: Management applications can now request receiving S4 events.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:19:19 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:
Bug Depends On: 827499    
Bug Blocks: 761491, 804821, 808463    

Description Luiz Capitulino 2012-07-12 14:02:36 UTC
QMP will soon get support to emit an event when the guest suspends to disk (S4). Libvirt should recognize this event.

Comment 3 Ademar Reis 2012-07-30 20:42:04 UTC
Do we already have support for the S3 event in libvirt? Otherwise we should either open a new bug or change this one to include the S3 event as well (the event is there in qemu already).

Comment 4 Martin Kletzander 2012-07-31 08:40:13 UTC
(In reply to comment #3)
Yes, S3 event is already supported in libvirt (since 0.9.11 if I'm right). We are just waiting how the new event will be implemented to modify the code accordingly.

Comment 8 hongming 2012-10-16 10:17:33 UTC
Because the following result. Change its status to ASSIGNED.

# rpm -q libvirt
libvirt-0.10.2-3.el6.x86_64


# python /usr/share/doc/libvirt-python-0.10.2/events-python/event-test.py 
Using uri:qemu:///system
Traceback (most recent call last):
  File "/usr/share/doc/libvirt-python-0.10.2/events-python/event-test.py", line 570, in <module>
    main()
  File "/usr/share/doc/libvirt-python-0.10.2/events-python/event-test.py", line 557, in main
    vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK, myDomainEventPMSuspendDiskCallback, None)
NameError: global name 'myDomainEventPMSuspendDiskCallback' is not defined
Closing <libvirt.virConnect instance at 0x1704638>

Comment 10 hongming 2012-10-17 03:50:59 UTC
Verify it as follows. The result is expected. So move its status to VERIFIED.

# rpm -q libvirt 
libvirt-0.10.2-4.el6.x86_64


# virsh list --all
 Id    Name                           State
----------------------------------------------------
 1     rhel6.3-new                    running

# virsh dompmsuspend rhel6.3-new --target disk
Domain rhel6.3-new successfully suspended

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     rhel6.3-new                    shut off

# virsh start rhel6.3-new
Domain rhel6.3-new started

# python /usr/share/doc/libvirt-python-0.10.2/events-python/event-test.py 
Using uri:qemu:///system
myDomainEventPMSuspendDiskCallback: Domain rhel6.3-new(6) system pmsuspend_disk
myDomainEventCallback1 EVENT: Domain rhel6.3-new(6) PMSuspended Disk
myDomainEventCallback2 EVENT: Domain rhel6.3-new(6) PMSuspended Disk
myDomainEventCallback1 EVENT: Domain rhel6.3-new(6) Shutdown Finished
myDomainEventCallback2 EVENT: Domain rhel6.3-new(6) Shutdown Finished
myDomainEventCallback1 EVENT: Domain rhel6.3-new(6) Stopped Shutdown
myDomainEventCallback2 EVENT: Domain rhel6.3-new(6) Stopped Shutdown
myDomainEventCallback1 EVENT: Domain rhel6.3-new(7) Started Booted
myDomainEventCallback2 EVENT: Domain rhel6.3-new(7) Started Booted

Comment 11 errata-xmlrpc 2013-02-21 07:19:19 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