qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] block: fix last address-of-packed-member warnings
@ 2018-12-10 11:26 Peter Maydell
  2018-12-10 11:26 ` [Qemu-devel] [PATCH 1/3] block/vpc: Don't take address of fields in packed structs Peter Maydell
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Peter Maydell @ 2018-12-10 11:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: patches, qemu-block, Fam Zheng, Igor Mammedov, Michael S. Tsirkin,
	Ben Warren, Max Reitz, Kevin Wolf, Stefan Weil

This patchset fixes the remaining clang warnings in the block/ code
about taking the address of a packed struct member, which are all
in block/vpc and block/vdi code handling UUIDs. Mostly I fix
these by copying the unaligned field to/from a local variable.
In the case of qemu_uuid_bswap() I opted to change the API to
take and return the QemuUUID rather than taking a pointer to it,
which makes almost all the callsites simpler. This does mean
a struct copy but the struct is only 16 bytes and I didn't
judge any of the callsites performance-sensitive enough to care
about a struct copy of that size.

As usual, tested with "make check" only.

thanks
-- PMM


Peter Maydell (3):
  block/vpc: Don't take address of fields in packed structs
  block/vdi: Don't take address of fields in packed structs
  uuid: Make qemu_uuid_bswap() take and return a QemuUUID

 include/qemu/uuid.h  |  2 +-
 block/vdi.c          | 54 +++++++++++++++++++++++++++-----------------
 block/vpc.c          |  4 +++-
 hw/acpi/vmgenid.c    |  6 ++---
 tests/vmgenid-test.c |  2 +-
 util/uuid.c          | 10 ++++----
 6 files changed, 45 insertions(+), 33 deletions(-)

-- 
2.19.2

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-02-01 10:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-10 11:26 [Qemu-devel] [PATCH 0/3] block: fix last address-of-packed-member warnings Peter Maydell
2018-12-10 11:26 ` [Qemu-devel] [PATCH 1/3] block/vpc: Don't take address of fields in packed structs Peter Maydell
2018-12-10 11:26 ` [Qemu-devel] [PATCH 2/3] block/vdi: " Peter Maydell
2018-12-10 11:26 ` [Qemu-devel] [PATCH 3/3] uuid: Make qemu_uuid_bswap() take and return a QemuUUID Peter Maydell
2018-12-10 11:37   ` Marc-André Lureau
2018-12-10 17:57   ` Michael S. Tsirkin
2019-01-18 13:59 ` [Qemu-devel] [PATCH 0/3] block: fix last address-of-packed-member warnings Peter Maydell
2019-01-18 16:17 ` Kevin Wolf
2019-02-01 10:30   ` Peter Maydell
2019-02-01 10:57     ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).