[Spice-devel] [PATCH 08/10] server/inputs_channel: use outgoing marshaller in red_channel/RedChannel

Alon Levy alevy at redhat.com
Thu Jan 13 15:29:07 PST 2011


On Thu, Jan 13, 2011 at 08:52:38AM +0100, Hans de Goede wrote:
> Hi,
> 
> Hi,
> 
> On 01/13/2011 06:01 AM, Alon Levy wrote:
> 
> <snip>
> 
> >-static void inputs_pipe_add_init(InputsChannel *channel)
> >+static void inputs_pipe_add_init(InputsChannel *inputs_channel)
> >  {
> >-    SpiceMsgInputsInit inputs_init;
> >-    InputsPipeItem *pipe_item = inputs_pipe_item_new(channel, PIPE_ITEM_INIT);
> >-    SpiceMarshaller *m = pipe_item->m;
> >+    InputsPipeItem *item = inputs_pipe_item_new(inputs_channel, PIPE_ITEM_INIT);
> >
> >-    inputs_init.keyboard_modifiers = kbd_get_leds(keyboard);
> >-    spice_marshall_msg_inputs_init(m,&inputs_init);
> >-    red_channel_pipe_add(&channel->base,&pipe_item->base);
> >+    red_channel_pipe_add(&inputs_channel->base,&item->base);
> >  }
> >
> 
> You seem to no longer be setting the keyboard_modifiers of the init message.

It's actually set in the marshalling part, server/inputs_channel.c:266

        case PIPE_ITEM_INIT:
        {
            SpiceMsgInputsInit inputs_init;

            inputs_init.keyboard_modifiers = kbd_get_leds(keyboard);
            spice_marshall_msg_inputs_init(m, &inputs_init);
        }

pipe_add generally does the minimal amount of work, just adding an entry
into the pipe. The only reason to add data into a pipe item is if there
is something that needs to be passed to the marshalling stage which makes
more sense to store in the PipeItem instance - in this case kbd_get_leds
can just be called at marshalling time.

> 
> <snip>
> 
> Regards,
> 
> Hans
> 
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list