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

Gerd Hoffmann kraxel at redhat.com
Tue Aug 7 23:45:06 PDT 2012


  Hi,

>      header.magic = SPICE_MAGIC;
>      header.size = sizeof(ack);
> -    header.major_version = SPICE_VERSION_MAJOR;
> -    header.minor_version = SPICE_VERSION_MINOR;
> +    header.major_version = htole32(SPICE_VERSION_MAJOR);
> +    header.minor_version = htole32(SPICE_VERSION_MINOR);

Why you don't swap magic & size too?

> +    header.size += (channel_caps->num_common_caps + channel_caps->num_caps) * sizeof(uint32_t);

> +    header.size = htole32(header.size);

Ah, this explains it for the size.
I still think you must swap magic too.

> @@ -1288,11 +1323,12 @@ static int reds_send_link_error(RedLinkInfo *link, uint32_t error)
>      SpiceLinkReply reply;
>  
>      header.magic = SPICE_MAGIC;

Same here.

cheers,
  Gerd


More information about the Spice-devel mailing list