[Spice-devel] [PATCH] add vd_agent announce capabilities message

Alon Levy alevy at redhat.com
Sun Aug 29 10:22:07 PDT 2010


This adds a 256 bits capabilities bitmap message to spice-protocol.


---
 spice/vd_agent.h |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/spice/vd_agent.h b/spice/vd_agent.h
index 8e1e6ca..9007bee 100644
--- a/spice/vd_agent.h
+++ b/spice/vd_agent.h
@@ -54,6 +54,7 @@ enum {
     VD_AGENT_REPLY,
     VD_AGENT_CLIPBOARD,
     VD_AGENT_DISPLAY_CONFIG,
+    VD_AGENT_ANNOUNCE_CAPABILITIES,
 };
 
 typedef struct SPICE_ATTR_PACKED VDAgentMonConfig {
@@ -119,6 +120,22 @@ enum {
     VD_AGENT_CLIPBOARD_UTF8_TEXT = 1,
 };
 
+enum {
+    // supports DisplayConfig message
+    VD_AGENT_CAP_DISPLAY_CONFIG=0,
+
+    VD_AGENT_CAP_MAX=256,
+};
+
+typedef struct SPICE_ATTR_PACKED VDAgentAnnounceCapabilities {
+    uint32_t caps[256/(sizeof(uint32_t)*8)];
+} VDAgentAnnounceCapabilities;
+
+#define VD_AGENT_HAS_CAPABILITY(caps, index) \
+    (caps[index >> 8] & (1 << (index & 0xf)))
+
+#define VD_AGENT_SET_CAPABILITY(caps, index) \
+    { caps[index >> 8] |= (1 << (index & 0xf)); }
 
 #include <spice/end-packed.h>
 
-- 
1.7.2



More information about the Spice-devel mailing list