[Spice-devel] [PATCH 06/14] FIXME/HACK: RedPipeItem/VDIPortBuf refcounting hack

Frediano Ziglio fziglio at redhat.com
Mon Apr 11 10:43:36 UTC 2016


> 
> On Fri, Apr 08, 2016 at 09:48:32AM +0200, Pavel Grunt wrote:
> > Hi,
> > 
> > On Thu, 2016-04-07 at 17:11 -0500, Jonathon Jongsma wrote:
> > > From: Christophe Fergeau<cfergeau at redhat.com>
> > > 
> > > related to 7d375e0
> > > workaround a runtime check in red_pipe_item_ref()
> > 
> > Should the refcount be initialized by red_pipe_item_init?
> 
> It is, the trick with VDIReadBuf is that they are stored in a list of
> preallocated, when refcounts drops to 0, the buffer is placed back in
> the static list, so when we try to reuse it, refcount is 0, and we try
> to resurrect it, which is not expected as the code is now.
> Definitely not saying this commit is the right way of handling things
> though given the name ;) Maybe we should just have a list of dynamically
> allocated VDIReadBuf, maybe we should do something different.
> 
> Christophe
> 

I would actually call ref_pipe_item_init again. After calling free_func
object should be considered freed so calling init again sounds
reasonable.
I would merge this in the previous patch.

Frediano


More information about the Spice-devel mailing list