[Spice-devel] [protocol] protocol: Add some comments to vd_agentd.h

Francois Gouget fgouget at codeweavers.com
Thu Jul 11 13:10:14 UTC 2019


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---

Just a minor patch partly inspired by a patch from Frediano Ziglio.
5975a98a94e0 at git://people.freedesktop.org/~fziglio/spice-protocol

The "client|server" comments bear verification: they're based on a 
comment in do_client_monitors() in vdagentd.c that implies 
VD_AGENT_MONITORS_CONFIG can be sent by either the client or server 
which I'm not sure is true.


 spice/vd_agent.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/spice/vd_agent.h b/spice/vd_agent.h
index 42ec77a..0662e44 100644
--- a/spice/vd_agent.h
+++ b/spice/vd_agent.h
@@ -62,15 +62,22 @@ typedef struct SPICE_ATTR_PACKED VDAgentMessage {
 #define VD_AGENT_CLIPBOARD_MAX_SIZE_ENV "SPICE_CLIPBOARD_MAX_SIZE"
 #endif
 
+
+/* vdagentd socket messages and types */
+
 enum {
+    /* server -> agent */
     VD_AGENT_MOUSE_STATE = 1,
+    /* client|server -> agent (acknowledged using VD_AGENT_REPLY) */
     VD_AGENT_MONITORS_CONFIG,
+    /* agent -> client|server */
     VD_AGENT_REPLY,
     /* Set clipboard data (both directions).
      * Message comes with type and data.
      * See VDAgentClipboard structure.
      */
     VD_AGENT_CLIPBOARD,
+    /* client -> agent */
     VD_AGENT_DISPLAY_CONFIG,
     VD_AGENT_ANNOUNCE_CAPABILITIES,
     /* Asks to listen for clipboard changes (both directions).
@@ -254,7 +261,7 @@ typedef struct SPICE_ATTR_PACKED VDAgentDeviceDisplayInfo {
     uint32_t monitor_id;
     uint32_t device_display_id;
     uint32_t device_address_len;
-    uint8_t device_address[0];  // a zero-terminated string
+    uint8_t device_address[0];  /* a zero-terminated string */
 } VDAgentDeviceDisplayInfo;
 
 
@@ -270,6 +277,9 @@ typedef struct SPICE_ATTR_PACKED VDAgentGraphicsDeviceInfo {
     VDAgentDeviceDisplayInfo display_info[0];
 } VDAgentGraphicsDeviceInfo;
 
+
+/* Capabilities definitions */
+
 enum {
     VD_AGENT_CAP_MOUSE_STATE = 0,
     VD_AGENT_CAP_MONITORS_CONFIG,
-- 
2.20.1


More information about the Spice-devel mailing list