From: Zhi Yong Wu Date: Sat, 28 Apr 2012 07:38:08 +0000 (+0800) Subject: qcow2: fix endianness conversion X-Git-Tag: v1.1.1~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=02fe741375d4993b3d6870ff6466cc775b409ba1;p=thirdparty%2Fqemu.git qcow2: fix endianness conversion Signed-off-by: Zhi Yong Wu Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf (cherry picked from commit 87267753a36798e25262ee48264bea2ab70921aa) Signed-off-by: Michael Roth --- diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 812c93c5c7a..443c02145ac 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -367,7 +367,7 @@ static int alloc_refcount_block(BlockDriverState *bs, } for(i = 0; i < table_size; i++) { - cpu_to_be64s(&new_table[i]); + be64_to_cpus(&new_table[i]); } /* Hook up the new refcount table in the qcow2 header */