Features/Guest S4 support: Difference between revisions

From QEMU
(Add 'what', 'why', example cmd line for putting Linux in S4)
 
(2 intermediate revisions by one other user not shown)
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 fileOne 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.
* 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.
* S4 is a standard operation for desktops, and making sure this functionality works is a good thing to do.

Latest revision as of 14:15, 11 October 2016

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