]> git.proxmox.com Git - qemu.git/commitdiff
qemu-ga: add guest-suspend-hybrid
authorLuiz Capitulino <lcapitulino@redhat.com>
Tue, 28 Feb 2012 14:03:05 +0000 (11:03 -0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 12 Mar 2012 20:09:18 +0000 (15:09 -0500)
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi-schema-guest.json
qga/commands-posix.c
qga/commands-win32.c

index b1023110d736d3a73675d140354b25e9b90883f6..6a755529c753268a2c040549644a1f33f96b5433 100644 (file)
 # Since: 1.1
 ##
 { 'command': 'guest-suspend-ram' }
+
+##
+# @guest-suspend-hybrid
+#
+# Save guest state to disk and suspend to ram.
+#
+# This command requires the pm-utils package to be installed in the guest.
+#
+# IMPORTANT: guest-suspend-hybrid requires QEMU to support the 'system_wakeup'
+# command.  Thus, it's *required* to query QEMU for the presence of the
+# 'system_wakeup' command before issuing guest-suspend-hybrid.
+#
+# Returns: nothing on success
+#          If hybrid suspend is not supported, Unsupported
+#
+# Notes: o This is an asynchronous request. There's no guarantee a response
+#          will be sent
+#        o It's strongly recommended to issue the guest-sync command before
+#          sending commands when the guest resumes
+#
+# Since: 1.1
+##
+{ 'command': 'guest-suspend-hybrid' }
index 134c130d08d1b34c1a7ea281b63c461d1c90ca64..79571bf8cc2b125a1a7deb19923020751be09900 100644 (file)
@@ -715,6 +715,16 @@ void qmp_guest_suspend_ram(Error **err)
     guest_suspend("pm-suspend", "mem", err);
 }
 
+void qmp_guest_suspend_hybrid(Error **err)
+{
+    bios_supports_mode("pm-is-supported", "--suspend-hybrid", NULL, err);
+    if (error_is_set(err)) {
+        return;
+    }
+
+    guest_suspend("pm-suspend-hybrid", NULL, err);
+}
+
 /* register init/cleanup routines for stateful command groups */
 void ga_command_state_init(GAState *s, GACommandState *cs)
 {
index b19a63ccf66abd75721df8ad4e48f96e8192d550..7ef185f5875bfa89b0cf091af0ce0274b401c83c 100644 (file)
@@ -134,6 +134,11 @@ void qmp_guest_suspend_ram(Error **err)
     error_set(err, QERR_UNSUPPORTED);
 }
 
+void qmp_guest_suspend_hybrid(Error **err)
+{
+    error_set(err, QERR_UNSUPPORTED);
+}
+
 /* register init/cleanup routines for stateful command groups */
 void ga_command_state_init(GAState *s, GACommandState *cs)
 {