vfio: move implement of vfio_get_xlat_addr() to memory.c
commitbaa44bce87fe53ef5c95d39e634b3bace014d235
authorCindy Lu <lulu@redhat.com>
Mon, 31 Oct 2022 03:10:19 +0000 (31 11:10 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 7 Nov 2022 19:08:17 +0000 (7 14:08 -0500)
tree4d88102332e623600399a3e295f2141d1a1d563b
parentbe3afe8151e8db8dba02cad9d846aaad908bd711
vfio: move implement of vfio_get_xlat_addr() to memory.c

- Move the implement vfio_get_xlat_addr to softmmu/memory.c, and
  change the name to memory_get_xlat_addr(). So we can use this
  function on other devices, such as vDPA device.
- Add a new function vfio_get_xlat_addr in vfio/common.c, and it will check
  whether the memory is backed by a discard manager. then device can
  have its own warning.

Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20221031031020.1405111-2-lulu@redhat.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/vfio/common.c
include/exec/memory.h
softmmu/memory.c