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

Alexander Larsson alexl at redhat.com
Mon Aug 30 00:02:54 PDT 2010


On Sun, 2010-08-29 at 13:22 -0400, Alon Levy wrote:
> 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;

Why do you use a fixed size for this? Just send the size of the array,
then we can send a smaller size now and expand it dynamically. Just
assume every capability bit not sent is zero if you get a short array in
the client.


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
       alexl at redhat.com            alexander.larsson at gmail.com 
He's an ungodly amnesiac filmmaker with a passion for fast cars. She's a 
provocative foul-mouthed socialite from Mars. They fight crime! 



More information about the Spice-devel mailing list