Features/Guest S4 support

From QEMU
Revision as of 17:56, 28 November 2011 by Amit (talk | contribs) (Add 'what', 'why', example cmd line for putting Linux in S4)

What

Putting guests into 'hibernate' or ACPI S4 state needs guest co-operation, as ACPI doesn't define a standard way via keystrokes or ACPI commands to put a guest into hibernate state. Similar to powerdown and reboot commands, a robust implementation for guest S4 will have to be implemented via commands in the guest agent.

Why

  • Can help for block migration: Migrating guests along with their storage is tricky; the guest needs to sync all data to the disk before the two hosts access the image file. One way to make sure guests don't access the disk is by adding a new guest command to stop disk accesses. However, using the existing guest S4 code, the need for this new command is invalidated.
  • S4 is a standard operation for desktops, and making sure this functionality works is a good thing to do.

How

  • New guest agent command to put guest into S4 state

Libvirt support

qemu guest agent

ovirt guest agent

Linux guest support

GNOME desktop-specific

KDE desktop-specific

desktop environment agnostic

  • For Linux guests, without worrying about the desktops, it's quite easy to put the guest into S4 state with the following command:
 echo 'disk' > /sys/power/state

Of course, this assumes the guest is setup for handling hibernation and resume from hibernation properly (adequate swap space, etc.).


Windows guest support