virtio-serial: Fix endianness bug in the config space
commit5c1c9bb24b20fb5844d01ac67d51c26941db5af1
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Tue, 19 Apr 2011 02:03:46 +0000 (19 12:03 +1000)
committerAmit Shah <amit.shah@redhat.com>
Thu, 28 Apr 2011 07:05:49 +0000 (28 12:35 +0530)
tree254a686834d27ea7af9fc8d242684cef81c8f835
parentda7d998bbb80f141ed5743418a4dfa5c1409e75f
virtio-serial: Fix endianness bug in the config space

The virtio serial specification requres that the values in the config
space are encoded in native endian of the guest.

The qemu virtio-serial code did not do conversion to the guest endian
format what caused problems when host and guest use different format.

This patch corrects the qemu side, correctly doing host-native <->
guest-native conversions when accessing the config space. This won't
break any setups that aren't already broken, and fixes the case
of different host and guest endianness.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
hw/virtio-serial-bus.c