vfio: Move VFIOAddressSpace helpers into container-base.c

VFIOAddressSpace is a common object used by VFIOContainerBase which is
declared in "hw/vfio/vfio-container-base.h". Move the VFIOAddressSpace
related services into "container-base.c".

While at it, rename :

  vfio_get_address_space -> vfio_address_space_get
  vfio_put_address_space -> vfio_address_space_put

to better reflect the namespace these routines belong to.

Reviewed-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-15-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
Cédric Le Goater 2025-03-26 08:50:59 +01:00
parent 0778f9b3be
commit d158ed0923
7 changed files with 64 additions and 61 deletions

View file

@ -546,7 +546,7 @@ static bool vfio_connect_container(VFIOGroup *group, AddressSpace *as,
VFIOAddressSpace *space;
VFIOIOMMUClass *vioc;
space = vfio_get_address_space(as);
space = vfio_address_space_get(as);
/*
* VFIO is currently incompatible with discarding of RAM insofar as the
@ -675,7 +675,7 @@ close_fd_exit:
close(fd);
put_space_exit:
vfio_put_address_space(space);
vfio_address_space_put(space);
return false;
}
@ -714,7 +714,7 @@ static void vfio_disconnect_container(VFIOGroup *group)
close(container->fd);
object_unref(container);
vfio_put_address_space(space);
vfio_address_space_put(space);
}
}