Hello Markus,
On 6/2/2025 5:32 AM, Markus Armbruster wrote:
Annie Li <annie...@oracle.com> writes:
Following hmp/qmp commands are implemented for pressing virtual
sleep button,
hmp: system_sleep
qmp: { "execute": "system_sleep" }
These commands put the guest into suspend or other power states
depending on the power settings inside the guest.
These hmp/qmp command are in '*_*' format, it is intended to do
so to align to existing 'system_*' commands.
Signed-off-by: Annie Li <annie...@oracle.com>
[...]
diff --git a/qapi/machine.json b/qapi/machine.json
index a6b8795b09..3efaf82f7d 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -361,6 +361,26 @@
##
{ 'command': 'system_reset' }
+##
+# @system_sleep:
+#
+# Requests that the guest perform a ACPI sleep transition by pushing
+# the virtual sleep button.
+#
+# Since:10.0
10.1
Good catch.
+#
+# .. note:: A guest may or may not respond to this command. This
+# command returning does not indicate that a guest has
+# accepted the request or that it has gone to sleep.
Please indent like this for consistency:
Nod
# .. note:: A guest may or may not respond to this command. This
# command returning does not indicate that a guest has accepted the
# request or that it has gone to sleep.
The same note on system_powerdown additionally has "Many guests will respond to
this command by prompting the user in some way." I guess you did not
copy this part, because it's not true here. Correct?
Very likely(but ignored indentation).
Don't recall clearly since it has been a while since RFC V1 patch :)
Thanks
Annie
+#
+# .. qmp-example::
+#
+# -> { "execute": "system_sleep" }
+# <- { "return": {} }
+#
+##
+{ 'command': 'system_sleep' }
+
##
# @system_powerdown:
#
diff --git a/qapi/pragma.json b/qapi/pragma.json
index 023a2ef7bc..285ce82e9b 100644
--- a/qapi/pragma.json
+++ b/qapi/pragma.json
@@ -23,6 +23,7 @@
'set_password',
'system_powerdown',
'system_reset',
+ 'system_sleep',
'system_wakeup' ],
# Commands allowed to return a non-dictionary
'command-returns-exceptions': [