qxl: avoid unaligned pointer reads/writes
commit94932c95c10400acd286fd768a6b411e7ebbec8f
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 12 Apr 2019 12:16:26 +0000 (12 13:16 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 7 May 2019 07:55:07 +0000 (7 09:55 +0200)
tree6a366ba90b3556b8945ccc90ab4d2a4011c1cc0c
parentdceb885255b8f7c79ab440ea242c9180bfaf4a84
qxl: avoid unaligned pointer reads/writes

The SPICE_RING_PROD_ITEM() macro is initializing a local
'uint64_t *' variable to point to the 'el' field inside
the QXLReleaseRing struct. This uint64_t field is not
guaranteed aligned as the struct is packed.

Code should not take the address of fields within a
packed struct. Changing the SPICE_RING_PROD_ITEM()
macro to avoid taking the address of the field is
impractical. It is clearer to just remove the macro
and inline its functionality in the three call sites
that need it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190412121626.19829-6-berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/qxl.c