Features/Guest S4 support: Difference between revisions

From QEMU
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 target host accesses the image fileOne way to make sure guests don't access the disk is by adding a new guest command to stop disk accessesHowever, using the existing guest S4 code, we can do this without the guest realising anything changed.
* Alternative solution to migration to file in cases where guests need to be stopped (e.g., host system going down for maintenance)Migration to file can cause the guest time keeping to go out of syncS4, on the other hand, is implemented by the guest itself and the guest can and does recover from timekeeping deltas after S4.


* 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 11:16, 12 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

  • Alternative solution to migration to file in cases where guests need to be stopped (e.g., host system going down for maintenance). Migration to file can cause the guest time keeping to go out of sync. S4, on the other hand, is implemented by the guest itself and the guest can and does recover from timekeeping deltas after S4.
  • 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