diff options
author | Peter Maydell | 2018-12-10 12:26:49 +0100 |
---|---|---|
committer | Kevin Wolf | 2019-02-01 13:46:45 +0100 |
commit | 1324f06384870fdd6e5829dc4f775afe4de61867 (patch) | |
tree | 5435a92d2e2ff5dc6ba24d2b37a1fd3f11d2c158 /include | |
parent | block/vdi: Don't take address of fields in packed structs (diff) | |
download | qemu-1324f06384870fdd6e5829dc4f775afe4de61867.tar.gz qemu-1324f06384870fdd6e5829dc4f775afe4de61867.tar.xz qemu-1324f06384870fdd6e5829dc4f775afe4de61867.zip |
uuid: Make qemu_uuid_bswap() take and return a QemuUUID
Currently qemu_uuid_bswap() takes a pointer to the QemuUUID to
be byte-swapped. This means it can't be used when the UUID
to be swapped is in a packed member of a struct. It's also
out of line with the general bswap*() functions we provide
in bswap.h, which take the value to be swapped and return it.
Make qemu_uuid_bswap() take a QemuUUID and return the swapped version.
This fixes some clang warnings about taking the address of
a packed struct member in block/vdi.c.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/qemu/uuid.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/qemu/uuid.h b/include/qemu/uuid.h index 09489ce5c5..037357d990 100644 --- a/include/qemu/uuid.h +++ b/include/qemu/uuid.h @@ -56,6 +56,6 @@ char *qemu_uuid_unparse_strdup(const QemuUUID *uuid); int qemu_uuid_parse(const char *str, QemuUUID *uuid); -void qemu_uuid_bswap(QemuUUID *uuid); +QemuUUID qemu_uuid_bswap(QemuUUID uuid); #endif |