[Spice-devel] [PATCH 04/14] reds: Put PipeItem first in VDIReadBuf

Christophe Fergeau cfergeau at redhat.com
Mon Apr 11 07:40:21 UTC 2016


On Fri, Apr 08, 2016 at 03:33:03PM -0500, Jonathon Jongsma wrote:
> I don't know if something got messed up during a rebase (that doesn't appear to
> be the case), but I don't really understand this commit or how the patch relates
> to the commit log...
> 

Fairly cryptic indeed, and it does not seem to have been impacted by
rebases... :)
The shortlog should be s/PipeItem/RingItem, and then what it means is
that with this change, the layout of the VDIReadBuf struct makes it
close enough to RedPipeItem (the refcounted one), that we can replace
it.
Layout becomes:

typedef struct VDIReadBuf {
    RingItem link;
    uint32_t refs;
    ....
}


which is close enough to

typedef struct PipeItem {
    RingItem link;
    int type;
} PipeItem;


typedef struct {
    PipeItem parent;

    /* private */
    int refcount;

    GDestroyNotify free_func;
} RedPipeItem;

So we can abuse the RedPipeItem stuff to get refcounting there. Given
the subsequent "HACK" commit, maybe this is not such a good idea, and
these VDIReadBuf changes could be dropped if they don't bring other
benefits some place else.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160411/4faf8a99/attachment.sig>


More information about the Spice-devel mailing list