[Spice-devel] [PATCH v1 07/10] Spicevmc: don't pass pipe item to init_send_data()

Jonathon Jongsma jjongsma at redhat.com
Wed Dec 14 20:58:06 UTC 2016


On Wed, 2016-12-14 at 15:27 -0500, Frediano Ziglio wrote:
> > 
> > 
> > ---
> >  server/spicevmc.c | 14 +++++++++++---
> >  1 file changed, 11 insertions(+), 3 deletions(-)
> > 
> > diff --git a/server/spicevmc.c b/server/spicevmc.c
> > index d6a6ac8..521a540 100644
> > --- a/server/spicevmc.c
> > +++ b/server/spicevmc.c
> > @@ -627,6 +627,12 @@ static void
> > spicevmc_red_channel_release_msg_rcv_buf(RedChannelClient *rcc,
> >      }
> >  }
> >  
> > +static void marshaller_free_pipe_item(uint8_t *data, void *opaque)
> > +{
> > +    RedPipeItem *item = opaque;
> > +    red_pipe_item_unref(item);
> > +}
> > +
> >  static void spicevmc_red_channel_send_data(RedChannelClient *rcc,
> >                                             SpiceMarshaller *m,
> >                                             RedPipeItem *item)
> > @@ -635,17 +641,19 @@ static void
> > spicevmc_red_channel_send_data(RedChannelClient *rcc,
> >  
> >      /* for compatibility send using not compressed data message */
> >      if (i->type == SPICE_DATA_COMPRESSION_TYPE_NONE) {
> > -        red_channel_client_init_send_data(rcc,
> > SPICE_MSG_SPICEVMC_DATA,
> > item);
> > +        red_channel_client_init_send_data(rcc,
> > SPICE_MSG_SPICEVMC_DATA,
> > NULL);
> >      } else {
> >          /* send as compressed */
> > -        red_channel_client_init_send_data(rcc,
> > SPICE_MSG_SPICEVMC_COMPRESSED_DATA, item);
> > +        red_channel_client_init_send_data(rcc,
> > SPICE_MSG_SPICEVMC_COMPRESSED_DATA, NULL);
> >          SpiceMsgCompressedData compressed_msg = {
> >              .type = i->type,
> >              .uncompressed_size = i->uncompressed_data_size
> >          };
> >          spice_marshall_SpiceMsgCompressedData(m, &compressed_msg);
> >      }
> > -    spice_marshaller_add_by_ref(m, i->buf, i->buf_used);
> > +    red_pipe_item_ref(item);
> > +    spice_marshaller_add_by_ref(m, i->buf, i->buf_used,
> > +                                marshaller_free_pipe_item, item);
> 
> Does not compile, here should be spice_marshaller_add_by_ref_full,
> the fix is in 8/10

OK, I'm confused. I rebased very soon before sending this, and it built
 fine for me after that. But now it's failing for some reason.  Sorry,
I'll investigate.

Jonathon


More information about the Spice-devel mailing list