Re: [PATCH spice-server] red-channel-client: Do not allocate iovec array statically in the class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>

On Mon, Jun 18, 2018 at 08:35:52AM +0100, Frediano Ziglio wrote:
> This array is just used locally in red_channel_client_handle_outgoing
> so declare it there.
> 
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
>  server/red-channel-client.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/server/red-channel-client.c b/server/red-channel-client.c
> index 893a764d..5d256eca 100644
> --- a/server/red-channel-client.c
> +++ b/server/red-channel-client.c
> @@ -101,8 +101,6 @@ typedef struct RedChannelClientConnectivityMonitor {
>  } RedChannelClientConnectivityMonitor;
>  
>  typedef struct OutgoingMessageBuffer {
> -    struct iovec vec[IOV_MAX];
> -    int vec_size;
>      int pos;
>      int size;
>  } OutgoingMessageBuffer;
> @@ -1081,10 +1079,11 @@ static void red_channel_client_handle_outgoing(RedChannelClient *rcc)
>      }
>  
>      for (;;) {
> -        buffer->vec_size =
> -            red_channel_client_prepare_out_msg(rcc, buffer->vec, G_N_ELEMENTS(buffer->vec),
> +        struct iovec vec[IOV_MAX];
> +        int vec_size =
> +            red_channel_client_prepare_out_msg(rcc, vec, G_N_ELEMENTS(vec),
>                                                 buffer->pos);
> -        n = red_stream_writev(stream, buffer->vec, buffer->vec_size);
> +        n = red_stream_writev(stream, vec, vec_size);
>          if (n == -1) {
>              switch (errno) {
>              case EAGAIN:
> -- 
> 2.17.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]