virtio-9p: fixed LE-to-host conversion bug when QEMU is called from guest
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Thu, 7 Apr 2011 03:02:03 +0000 (13:02 +1000)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Thu, 7 Apr 2011 13:25:53 +0000 (14:25 +0100)
commit4399a4533230a90c916b717325e31fa68e9c3daf
tree3b6c94154cce64cb2c7a88748675befc80296ed4
parent52c3f098dbf1740ad33f81360ea0669feefb7fab
virtio-9p: fixed LE-to-host conversion bug when QEMU is called from guest

The 9p code already contains an attempt at the necessary endian
conversions, but it's broken.

The code which does conversion from host to guest does it correctly
and this code was copied to the function which does guest to host
conversion.  However the copied code hasn't been correctly updated, so
it first endian converts some garbage on the stack and then overwrites
it with a field from incoming packet without conversion.

The patch fixes the mistakes.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/virtio-9p.c