spapr_iommu: Realloc guest visible TCE table when hot(un)plugging vfio-pci
commitf5509b6bebc68fc781f0823e628fead884fd69d4
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Thu, 20 Jul 2017 07:22:29 +0000 (20 17:22 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 7 Sep 2017 23:30:55 +0000 (8 09:30 +1000)
tree6ab59b29ad74cde8fb03f724288dda87272a306a
parent54a50dae93fa3c0b0bd6188ecf1777474d55648e
spapr_iommu: Realloc guest visible TCE table when hot(un)plugging vfio-pci

This replaces g_malloc() with spapr_tce_alloc_table() as this is
the standard way of allocating tables and this allows moving the table
back to KVM when unplugging a VFIO PCI device and VFIO TCE acceleration
support is not present in the KVM.

Although spapr_tce_alloc_table() is expected to fail with EBUSY
if called when previous fd is not closed yet, in practice we will not
see it because cap_spapr_vfio is false at the moment.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_iommu.c