summary refs log tree commit diff stats
path: root/hw/vfio/iommufd.c
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2024-02-22 09:28:37 -0800
committerCédric Le Goater <clg@redhat.com>2024-03-08 22:10:13 +0100
commitd9fa4223b30ab881cc2f506fda1fc6a86aad5529 (patch)
tree1b27db01aebfe377e7f07abbaa843d3d3872e3de /hw/vfio/iommufd.c
parentcbccded4a2b5d685a426a437e25f67d3a375b292 (diff)
downloadfocaccia-qemu-d9fa4223b30ab881cc2f506fda1fc6a86aad5529.tar.gz
focaccia-qemu-d9fa4223b30ab881cc2f506fda1fc6a86aad5529.zip
vfio: register container for cpr
Define entry points to perform per-container cpr-specific initialization
and teardown.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'hw/vfio/iommufd.c')
-rw-r--r--hw/vfio/iommufd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
index 9bfddc1360..e1be224494 100644
--- a/hw/vfio/iommufd.c
+++ b/hw/vfio/iommufd.c
@@ -411,6 +411,11 @@ found_container:
         goto err_listener_register;
     }
 
+    ret = vfio_cpr_register_container(bcontainer, errp);
+    if (ret) {
+        goto err_listener_register;
+    }
+
     /*
      * TODO: examine RAM_BLOCK_DISCARD stuff, should we do group level
      * for discarding incompatibility check as well?
@@ -461,6 +466,7 @@ static void iommufd_cdev_detach(VFIODevice *vbasedev)
         iommufd_cdev_ram_block_discard_disable(false);
     }
 
+    vfio_cpr_unregister_container(bcontainer);
     iommufd_cdev_detach_container(vbasedev, container);
     iommufd_cdev_container_destroy(container);
     vfio_put_address_space(space);