mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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>
This commit is contained in:
parent
cbccded4a2
commit
d9fa4223b3
5 changed files with 39 additions and 1 deletions
|
@ -621,10 +621,15 @@ static int vfio_connect_container(VFIOGroup *group, AddressSpace *as,
|
|||
goto free_container_exit;
|
||||
}
|
||||
|
||||
ret = vfio_cpr_register_container(bcontainer, errp);
|
||||
if (ret) {
|
||||
goto free_container_exit;
|
||||
}
|
||||
|
||||
ret = vfio_ram_block_discard_disable(container, true);
|
||||
if (ret) {
|
||||
error_setg_errno(errp, -ret, "Cannot set discarding of RAM broken");
|
||||
goto free_container_exit;
|
||||
goto unregister_container_exit;
|
||||
}
|
||||
|
||||
assert(bcontainer->ops->setup);
|
||||
|
@ -667,6 +672,9 @@ listener_release_exit:
|
|||
enable_discards_exit:
|
||||
vfio_ram_block_discard_disable(container, false);
|
||||
|
||||
unregister_container_exit:
|
||||
vfio_cpr_unregister_container(bcontainer);
|
||||
|
||||
free_container_exit:
|
||||
g_free(container);
|
||||
|
||||
|
@ -710,6 +718,7 @@ static void vfio_disconnect_container(VFIOGroup *group)
|
|||
vfio_container_destroy(bcontainer);
|
||||
|
||||
trace_vfio_disconnect_container(container->fd);
|
||||
vfio_cpr_unregister_container(bcontainer);
|
||||
close(container->fd);
|
||||
g_free(container);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue