aboutsummaryrefslogtreecommitdiff
path: root/ui/vnc.h
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2020-12-11 16:08:25 +0000
committerGerd Hoffmann <kraxel@redhat.com>2021-01-15 11:22:42 +0100
commit7b5fa0b583c8d54f4bc3be796c4086de39ea09d3 (patch)
tree798384dccac4e0086a0869bee71bf0a4e959ebb1 /ui/vnc.h
parent521534df57cc0bee7b0da9e69fbbaa7149036ddb (diff)
ui: add support for remote power control to VNC server
The "XVP" (Xen VNC Proxy) extension defines a mechanism for a VNC client to issue power control requests to trigger graceful shutdown, reboot, or hard reset. This option is not enabled by default, since we cannot assume that users with VNC access implicitly have administrator access to the guest OS. Thus is it enabled with a boolean "power-control" option e.g. -vnc :1,power-control=on While, QEMU can easily support shutdown and reset, there's no easy way to wire up reboot support at this time. In theory it could be done by issuing a shutdown, followed by a reset, but there's no convenient wiring for such a pairing in QEMU. It also isn't possible to have the VNC server directly talk to QEMU guest agent, since the agent chardev is typically owned by an external mgmt app. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> [ kraxel: rebase to master ] [ kraxel: add missing break ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/vnc.h')
-rw-r--r--ui/vnc.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/vnc.h b/ui/vnc.h
index c8d3ad9ec4..5feeef9df0 100644
--- a/ui/vnc.h
+++ b/ui/vnc.h
@@ -176,6 +176,7 @@ struct VncDisplay
int ws_subauth; /* Used by websockets */
bool lossy;
bool non_adaptive;
+ bool power_control;
QCryptoTLSCreds *tlscreds;
QAuthZ *tlsauthz;
char *tlsauthzid;
@@ -412,6 +413,7 @@ enum {
#define VNC_ENCODING_TIGHT_PNG 0xFFFFFEFC /* -260 */
#define VNC_ENCODING_LED_STATE 0XFFFFFEFB /* -261 */
#define VNC_ENCODING_DESKTOP_RESIZE_EXT 0XFFFFFECC /* -308 */
+#define VNC_ENCODING_XVP 0XFFFFFECB /* -309 */
#define VNC_ENCODING_ALPHA_CURSOR 0XFFFFFEC6 /* -314 */
#define VNC_ENCODING_WMVi 0x574D5669
@@ -453,6 +455,7 @@ enum VncFeatures {
VNC_FEATURE_ZRLE,
VNC_FEATURE_ZYWRLE,
VNC_FEATURE_LED_STATE,
+ VNC_FEATURE_XVP,
};
#define VNC_FEATURE_RESIZE_MASK (1 << VNC_FEATURE_RESIZE)
@@ -467,6 +470,7 @@ enum VncFeatures {
#define VNC_FEATURE_ZRLE_MASK (1 << VNC_FEATURE_ZRLE)
#define VNC_FEATURE_ZYWRLE_MASK (1 << VNC_FEATURE_ZYWRLE)
#define VNC_FEATURE_LED_STATE_MASK (1 << VNC_FEATURE_LED_STATE)
+#define VNC_FEATURE_XVP_MASK (1 << VNC_FEATURE_XVP)
/* Client -> Server message IDs */
@@ -519,6 +523,15 @@ enum VncFeatures {
#define VNC_MSG_SERVER_QEMU_AUDIO_BEGIN 1
#define VNC_MSG_SERVER_QEMU_AUDIO_DATA 2
+/* XVP server -> client status code */
+#define VNC_XVP_CODE_FAIL 0
+#define VNC_XVP_CODE_INIT 1
+
+/* XVP client -> server action request */
+#define VNC_XVP_ACTION_SHUTDOWN 2
+#define VNC_XVP_ACTION_REBOOT 3
+#define VNC_XVP_ACTION_RESET 4
+
/*****************************************************************************
*