[Spice-devel] [PATCH v1 00/10] Refactor red_channel_client_init_send_data()

Jonathon Jongsma jjongsma at redhat.com
Wed Dec 14 16:36:35 UTC 2016


A series of patches refactoring the somewhat-confusing
red_channel_client_init_send_data() function. The third argument to this
function is a RedPipeItem and it was never very obvious when or why we should
pass an item in this parameter. Sometimes callers passed NULL, and sometimes
they passed an item. It turns out that it's only necessary to pass the item to
this parameter if the pipe item needs to be kept alive until we guarantee that
the message has been sent. We only need to do this when we have marshalled some
data by reference, and that data is owned by the RedPipeItem. To make this more
obvious, I've attempted to refactor things so that we no longer rely on this
mechanism to keep the data alive, but instead reference the pipe item (or other
structure that owns the referenced data) call _add_by_ref_full() to unreference
the data after the message has been sent.

Jonathon Jongsma (10):
  Avoid passing pipe item to red_channel_client_init_send_data()
  Rename cursor_set_item() to cursor_channel_set_item()
  CursorChannel: minor improvement to cursor_fill()
  Refactor cursor marshalling for SET, INIT
  MainChannel: remove another init_send_data arg
  Smartcard: Don't pass pipe item to _init_send_data()
  Spicevmc: don't pass pipe item to init_send_data()
  DCC: remove more init_send_data() arguments
  DCC: change how fill_bits() marshalls data by reference
  Remove third argument from red_channel_client_init_send_data()

 server/cursor-channel.c             | 47 +++++++++++++++---------
 server/dcc-send.c                   | 72 +++++++++++++++++++++++++------------
 server/inputs-channel-client.c      |  2 +-
 server/inputs-channel.c             |  6 ++--
 server/main-channel-client.c        | 42 +++++++++++++---------
 server/red-channel-client-private.h |  1 -
 server/red-channel-client.c         | 17 +--------
 server/red-channel-client.h         |  2 +-
 server/smartcard-channel-client.c   | 14 ++++++--
 server/smartcard.c                  |  2 +-
 server/spicevmc.c                   | 20 +++++++----
 11 files changed, 138 insertions(+), 87 deletions(-)

-- 
2.7.4



More information about the Spice-devel mailing list