Hide Forgot
Similar to the guest shutdown command, we need a command to put a guest into hibernation state. For Linux guests, echo disk > /sys/power/state will do it.
Candidate sent to qemu-devel: http://lists.gnu.org/archive/html/qemu-devel/2011-12/msg01031.html
Time for a progress update on this one. I've submitted v4 some days ago: http://lists.gnu.org/archive/html/qemu-devel/2012-01/msg00435.html While there are a few things to be addressed in the patch, the main issue now is that we'll need some form of feature advertisement between qemu-ga and qemu, and the guest-suspend command depends on it. This happens because of S3 bugs, although it's likely we would need it anyway. Please, read the following discussion for detailed information: http://lists.gnu.org/archive/html/qemu-devel/2012-01/msg00495.html Now, it's not clear who's going to work on the feature advertisement implementation. I'll discuss this with Michael Roth soon.
Another update on this one. I've just submitted v7, which hopefully is going to be the last version: http://lists.gnu.org/archive/html/qemu-devel/2012-01/msg02158.html Patches introducing feature advertisement have also been posted by Michael and we have two solutions for the S3 problems mentioned in the last comment (both solutions also posted as patches upstream): 1. Add a QMP command to wake up from S3 (preferred method, posted by Gerd) 2. Disable S3 advertisement in the BIOS I believe it's just a matter of around a week to get all this merged upstream.
Last week we found a problem in the way we were handling S3 support/advertisement in qemu-ga, and part of the solution was to split the guest-suspend command into guest-suspend-disk, guest-suspend-ram and guest-suspend-hybrid. This required me to post V8: http://lists.gnu.org/archive/html/qemu-devel/2012-01/msg04093.html
Status update. The last available version of my series is still v8, as noted in comment 4. That series is on hold because it depends on two other series that haven't been merged upstream yet, they are: o Gerd system_wakeup command (http://lists.gnu.org/archive/html/qemu-devel/2012-02/msg01900.html) o A seabios fix from Gleb Both are still being reviewed discussed upstream.
This has finally been merged upstream (git log 8d9dde94..95f4f404e).
Test on the qemu-kvm-0.12.1.2-2.265.el6, we have the command "guest-suspend-disk" which can put guest into hibernate and resume successfully. Cli: # /usr/libexec/qemu-kvm -M rhel6.3.0 -cpu Conroe -enable-kvm -m 2G -smp 2,sockets=1,cores=2,threads=1 -name rhel6.3 -uuid 26427d77-37e8-4217-ad98-140b16fa18f4 -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x4 -drive file=/dev/vg-qzhang/lv-rhel6.3,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:2a:15:10:19,bus=pci.0 -drive file=/home/boot.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -chardev socket,path=/tmp/qga.sock,server,nowait,id=qga0 -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0,bus=virtio-serial0.0 -vnc :10 -usb -device usb-tablet,id=input0 -device virtio-balloon-pci,id=balloon0,addr=0x7 -monitor stdio -boot c -rtc-td-hack -rtc base=localtime -qmp tcp:0:4444,server,nowait 1. Boot guest and installqemu-guest-agent-0.12.1.2-2.265.el6 then start qemu-ga inside guest. #qemu-ga (default use virtio-serial transport method) 2. On host: # nc -U /tmp/qga.sock {"execute":"guest-suspend-disk"} {"return": {}} As a result, guest can hibernate, and can be resumed successfully. So this bug is fixed.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: No documentation needed.
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/RHBA-2012-0746.html