]> xenbits.xensource.com Git - libvirt.git/commit
virbpf: Fix typecast to __aligned_u64 type
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 18 Nov 2019 07:33:40 +0000 (08:33 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 18 Nov 2019 07:59:13 +0000 (08:59 +0100)
commit02bf7cc68bfc76242f02d23e73cad36618f3f790
tree14ad63dd554e7a71d9a68444aae142bce9b39e7b
parentc10b78370d589f3f20d9c18eebdb1758aaafdf73
virbpf: Fix typecast to __aligned_u64 type

In functions implemented here we fill this attr union (type of
bpf_attr) and just pass it to syscall(2). Thing is that some of
the union members are type of __aligned_u64. This is not regular
uint64_t. This one is explicitly aligned to 8 bytes, while
uint64_t can be aligned to 4 bytes (on 32 bits). We've used
explicit typecast to uint64_t to shut compiler which would
otherwise complain of assigning a pointer into an integer. Well,
we have uintptr_t just for that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virbpf.c