Annie Li <annie...@oracle.com> writes: > Followng 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..0965e78f4e 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 > +# > +# .. note:: A guest may or may not respond to this command. This Two spaces between sentences for consistency, please. > +# command returning does not indicate that a guest has > +# accepted the request or that it has gone to sleep. > +# > +# .. 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', Additions here are always sad, but inconsistency with the other system_FOO commands would be worse. > 'system_wakeup' ], > # Commands allowed to return a non-dictionary > 'command-returns-exceptions': [ With the spacing nit touched up: Acked-by: Markus Armbruster <arm...@redhat.com>