libqos: Give qvirtio_config_read*() consistent semantics
commit246fc0fb66cbf861b0e76320626b059e2d49ea12
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 20 Oct 2016 03:08:07 +0000 (20 14:08 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 27 Oct 2016 22:38:27 +0000 (28 09:38 +1100)
treefdd6e888573923271dbc08822239db16760f4c66
parenta37eb9fccdd423e4f430b0261ee78c1692b7c252
libqos: Give qvirtio_config_read*() consistent semantics

The 'addr' parameter to qvirtio_config_read*() doesn't have a consistent
meaning: when using the virtio-pci versions, it's a full PCI space address,
but for virtio-mmio, it's an offset from the device's base mmio address.

This means that the callers need to do different things to calculate the
addresses in the two cases, which rather defeats the purpose of function
pointer backends.

All the current users of these functions are using them to retrieve
variables from the device specific portion of the virtio config space.
So, this patch alters the semantics to always be an offset into that
device specific config area.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
tests/libqos/virtio-mmio.c
tests/libqos/virtio-pci.c
tests/virtio-9p-test.c
tests/virtio-blk-test.c
tests/virtio-scsi-test.c