Features/Guest S4 support: Difference between revisions

From QEMU
(Add 'what', 'why', example cmd line for putting Linux in S4)
Line 3: Line 3:


== Why ==
== 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.
* 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 target host accesses 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, we can do this without the guest realising anything changed.


* S4 is a standard operation for desktops, and making sure this functionality works is a good thing to do.
* S4 is a standard operation for desktops, and making sure this functionality works is a good thing to do.

Revision as of 07:51, 7 December 2011

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 target host accesses 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, we can do this without the guest realising anything changed.
  • 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