Fix L1 table endianess of qcow images created by tapdisk
The qemu/ioemu implementation of the qcow format uses a big endian L1
table. tapdisk omits the necessary conversion, so qcow images have the
wrong endianess and cannot be read by correct implementations of qcow.
This patch detects broken tapdisk images and converts their L1 tables
to big endian when the image file is opened in ioemu for the first
time. The fixed image has a new flag EXTHDR_L1_BIG_ENDIAN set in the
extended header.
Note that a converted image cannot be opened by tapdisk again.
Signed-off-by: Kevin Wolf <kwolf@suse.de>
Patch cross-ported to qemu xen from hg commit
c02deeae743221cbe9a1ac9769d21c292e267601
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>