aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-06-16 17:06:17 +0100
committerMax Reitz <mreitz@redhat.com>2016-07-05 16:54:04 +0200
commitf1f7a1ddf38f4261058c604c32c488a0b7af9814 (patch)
tree85b56569daeadaa1a924bb99263b4217b0e91fe3 /block/qcow2.c
parenta03ef88f77af045a2eb9629b5ce774a3fb973c5e (diff)
downloadqemu-f1f7a1ddf38f4261058c604c32c488a0b7af9814.zip
qemu-f1f7a1ddf38f4261058c604c32c488a0b7af9814.tar.gz
qemu-f1f7a1ddf38f4261058c604c32c488a0b7af9814.tar.bz2
block/qcow2: Don't use cpu_to_*w()
Don't use the cpu_to_*w() functions, which we are trying to deprecate. Instead either just use cpu_to_*() to do the byteswap, or use st*_be_p() if we need to do the store somewhere other than to a variable that's already the correct type. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1466093177-17890-1-git-send-email-peter.maydell@linaro.org Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index 8a2c568..a5ea19b 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2739,9 +2739,9 @@ static int make_completely_empty(BlockDriverState *bs)
/* "Create" an empty reftable (one cluster) directly after the image
* header and an empty L1 table three clusters after the image header;
* the cluster between those two will be used as the first refblock */
- cpu_to_be64w(&l1_ofs_rt_ofs_cls.l1_offset, 3 * s->cluster_size);
- cpu_to_be64w(&l1_ofs_rt_ofs_cls.reftable_offset, s->cluster_size);
- cpu_to_be32w(&l1_ofs_rt_ofs_cls.reftable_clusters, 1);
+ l1_ofs_rt_ofs_cls.l1_offset = cpu_to_be64(3 * s->cluster_size);
+ l1_ofs_rt_ofs_cls.reftable_offset = cpu_to_be64(s->cluster_size);
+ l1_ofs_rt_ofs_cls.reftable_clusters = cpu_to_be32(1);
ret = bdrv_pwrite_sync(bs->file, offsetof(QCowHeader, l1_table_offset),
&l1_ofs_rt_ofs_cls, sizeof(l1_ofs_rt_ofs_cls));
if (ret < 0) {