diff --git a/block-qcow2.c b/block-qcow2.c index 5f0fbe8f9e..693cd77278 100644 --- a/block-qcow2.c +++ b/block-qcow2.c @@ -917,7 +917,7 @@ static uint64_t alloc_cluster_offset(BlockDriverState *bs, /* how many free clusters ? */ while (i < nb_clusters) { - cluster_offset = l2_table[l2_index + i]; + cluster_offset = be64_to_cpu(l2_table[l2_index + i]); if (cluster_offset != 0) break; i++;