OSDN Git Service

vfio-pci: Fix BAR->VFIODevice translation in
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 8 Oct 2012 14:45:31 +0000 (08:45 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 8 Oct 2012 14:45:31 +0000 (08:45 -0600)
commit3a4f2816fac1b0f9cc197bb2208ddf03dc7bc592
treec0987f7626feec5d5dcbab01de7042448f1f04c8
parent1a40313381262ebb5f30fb95d5550b674280f396
vfio-pci: Fix BAR->VFIODevice translation in

DO_UPCAST is supposed to translate from the first member of a struct to
that struct, not from arbitrary ones. And it (usually) breaks the build
when neglecting this rule. Use container_of to fix the build breakage
and likely also the runtime behavior.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
aw: runtime behavior is actually the same, but clearly misuse of DO_UPCAST
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio_pci.c