QMP will soon get support to emit an event when the guest suspends to disk (S4). Libvirt should recognize this event.
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).
(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.
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>
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
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