[Spice-devel] [PATCH spice 2/3] reds: Constantify agent message parameter

Frediano Ziglio fziglio at redhat.com
Fri Jun 2 06:51:12 UTC 2017


> 
> Make clear that the function is not changing it
> ---
>  server/reds.c | 5 +++--
>  server/reds.h | 3 ++-
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/server/reds.c b/server/reds.c
> index 35d430494..8abeb3fbd 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -1087,7 +1087,7 @@ static void
> reds_client_monitors_config_cleanup(RedsState *reds)
>      cmc->buffer = NULL;
>  }
>  
> -static void reds_on_main_agent_monitors_config(RedsState *reds, void
> *message, size_t size)
> +static void reds_on_main_agent_monitors_config(RedsState *reds, const void
> *message, size_t size)
>  {
>      VDAgentMessage *msg_header;
>      VDAgentMonitorsConfig *monitors_config;
> @@ -1110,7 +1110,8 @@ static void
> reds_on_main_agent_monitors_config(RedsState *reds, void *message, s
>      reds_client_monitors_config_cleanup(reds);
>  }
>  
> -void reds_on_main_agent_data(RedsState *reds, MainChannelClient *mcc, void
> *message, size_t size)
> +void reds_on_main_agent_data(RedsState *reds, MainChannelClient *mcc, const
> void *message,
> +                             size_t size)
>  {
>      RedCharDeviceVDIPort *dev = reds->agent_dev;
>      VDIChunkHeader *header;
> diff --git a/server/reds.h b/server/reds.h
> index e5f70d571..bbd33b098 100644
> --- a/server/reds.h
> +++ b/server/reds.h
> @@ -79,7 +79,8 @@ void reds_on_main_agent_start(RedsState *reds,
> MainChannelClient *mcc, uint32_t
>  void reds_on_main_agent_tokens(RedsState *reds, MainChannelClient *mcc,
>  uint32_t num_tokens);
>  uint8_t *reds_get_agent_data_buffer(RedsState *reds, MainChannelClient *mcc,
>  size_t size);
>  void reds_release_agent_data_buffer(RedsState *reds, uint8_t *buf);
> -void reds_on_main_agent_data(RedsState *reds, MainChannelClient *mcc, void
> *message, size_t size);
> +void reds_on_main_agent_data(RedsState *reds, MainChannelClient *mcc, const
> void *message,
> +                             size_t size);
>  void reds_on_main_migrate_connected(RedsState *reds, int seamless); //should
>  be called when all the clients
>                                                     // are connected to the
>                                                     target
>  bool reds_handle_migrate_data(RedsState *recs, MainChannelClient *mcc,

Acked-by: Frediano Ziglio <fziglio at redhat.com>

Frediano


More information about the Spice-devel mailing list