[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/5] qapi: Restrict 'system wakeup/reset/powerdown' commands to ma
From: |
Markus Armbruster |
Subject: |
[PULL 2/5] qapi: Restrict 'system wakeup/reset/powerdown' commands to machine.json |
Date: |
Wed, 21 Oct 2020 05:32:54 +0200 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
Restricting system_wakeup/system_reset/system_powerdown to
machine.json pulls slightly less QAPI-generated code into
user-mode and tools.
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20201012121536.3381997-3-philmd@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
qapi/machine.json | 57 +++++++++++++++++++++++++++++++++++++++++++++++
qapi/misc.json | 57 -----------------------------------------------
ui/gtk.c | 1 +
ui/cocoa.m | 1 +
4 files changed, 59 insertions(+), 57 deletions(-)
diff --git a/qapi/machine.json b/qapi/machine.json
index 073b1c98b2..55328d4f3c 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -452,6 +452,63 @@
##
{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
+##
+# @system_reset:
+#
+# Performs a hard reset of a guest.
+#
+# Since: 0.14.0
+#
+# Example:
+#
+# -> { "execute": "system_reset" }
+# <- { "return": {} }
+#
+##
+{ 'command': 'system_reset' }
+
+##
+# @system_powerdown:
+#
+# Requests that a guest perform a powerdown operation.
+#
+# Since: 0.14.0
+#
+# Notes: 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 shut down. Many guests will respond to this command by
+# prompting the user in some way.
+# Example:
+#
+# -> { "execute": "system_powerdown" }
+# <- { "return": {} }
+#
+##
+{ 'command': 'system_powerdown' }
+
+##
+# @system_wakeup:
+#
+# Wake up guest from suspend. If the guest has wake-up from suspend
+# support enabled (wakeup-suspend-support flag from
+# query-current-machine), wake-up guest from suspend if the guest is
+# in SUSPENDED state. Return an error otherwise.
+#
+# Since: 1.1
+#
+# Returns: nothing.
+#
+# Note: prior to 4.0, this command does nothing in case the guest
+# isn't suspended.
+#
+# Example:
+#
+# -> { "execute": "system_wakeup" }
+# <- { "return": {} }
+#
+##
+{ 'command': 'system_wakeup' }
+
##
# @LostTickPolicy:
#
diff --git a/qapi/misc.json b/qapi/misc.json
index 3fe9cc21b4..90fd862a6c 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -177,40 +177,6 @@
##
{ 'command': 'stop' }
-##
-# @system_reset:
-#
-# Performs a hard reset of a guest.
-#
-# Since: 0.14.0
-#
-# Example:
-#
-# -> { "execute": "system_reset" }
-# <- { "return": {} }
-#
-##
-{ 'command': 'system_reset' }
-
-##
-# @system_powerdown:
-#
-# Requests that a guest perform a powerdown operation.
-#
-# Since: 0.14.0
-#
-# Notes: 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 shut down. Many guests will respond to this command by
-# prompting the user in some way.
-# Example:
-#
-# -> { "execute": "system_powerdown" }
-# <- { "return": {} }
-#
-##
-{ 'command': 'system_powerdown' }
-
##
# @memsave:
#
@@ -318,29 +284,6 @@
##
{ 'command': 'x-exit-preconfig', 'allow-preconfig': true }
-##
-# @system_wakeup:
-#
-# Wake up guest from suspend. If the guest has wake-up from suspend
-# support enabled (wakeup-suspend-support flag from
-# query-current-machine), wake-up guest from suspend if the guest is
-# in SUSPENDED state. Return an error otherwise.
-#
-# Since: 1.1
-#
-# Returns: nothing.
-#
-# Note: prior to 4.0, this command does nothing in case the guest
-# isn't suspended.
-#
-# Example:
-#
-# -> { "execute": "system_wakeup" }
-# <- { "return": {} }
-#
-##
-{ 'command': 'system_wakeup' }
-
##
# @human-monitor-command:
#
diff --git a/ui/gtk.c b/ui/gtk.c
index b11594d817..a752aa22be 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -33,6 +33,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-control.h"
+#include "qapi/qapi-commands-machine.h"
#include "qapi/qapi-commands-misc.h"
#include "qemu/cutils.h"
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 0910b4a716..f32adc3074 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -35,6 +35,7 @@
#include "sysemu/cpu-throttle.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-block.h"
+#include "qapi/qapi-commands-machine.h"
#include "qapi/qapi-commands-misc.h"
#include "sysemu/blockdev.h"
#include "qemu-version.h"
--
2.26.2
- [PULL 0/5] QAPI patches patches for 2020-10-21, Markus Armbruster, 2020/10/20
- [PULL 1/5] qapi: Restrict 'inject-nmi' command to machine code, Markus Armbruster, 2020/10/20
- [PULL 4/5] qapi: Restrict 'query-kvm' command to machine code, Markus Armbruster, 2020/10/20
- [PULL 3/5] qapi: Restrict '(p)memsave' command to machine code, Markus Armbruster, 2020/10/20
- [PULL 2/5] qapi: Restrict 'system wakeup/reset/powerdown' commands to machine.json,
Markus Armbruster <=
- [PULL 5/5] qapi: Restrict Xen migration commands to migration.json, Markus Armbruster, 2020/10/20
- Re: [PULL 0/5] QAPI patches patches for 2020-10-21, Peter Maydell, 2020/10/21