[Spice-devel] [PATCH 2/7] spice-ppc: Fixing endianess for channel startup negotiation

Christophe Fergeau cfergeau at redhat.com
Thu Aug 9 01:29:11 PDT 2012


On Wed, Aug 08, 2012 at 10:24:15AM -0300, Erlon Cruz wrote:
> On Wed, Aug 8, 2012 at 7:19 AM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> > I think it would be better to write a sync_write equivalent which reads an
> > array 4 bytes at a time and swaps them before sending, this will avoid the
> > need for the memdup and the helper function.
> 
> Do we really need to break the simplicity here?('convert the buffers
> to LE and send it'). This path is only called a few times.
> We would still need another function right? How about patching sync_write?

sync_write is probably used to send structures with char-sized fields, so
patching it wouldn't work out. Having a sync_write_htole (better name
welcome) makes things simpler imo, instead of converting and then sending,
you just send them and the correct transform is automatically applied.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120809/e7b3b6a7/attachment.pgp>


More information about the Spice-devel mailing list