]> git.ipfire.org Git - thirdparty/qemu.git/commit
vfio/container: ram discard disable helper
authorSteve Sistare <steven.sistare@oracle.com>
Fri, 2 May 2025 14:22:38 +0000 (07:22 -0700)
committerCédric Le Goater <clg@redhat.com>
Fri, 9 May 2025 10:42:27 +0000 (12:42 +0200)
commit2cc3643df568c9d274781ef896368fd50514fb3e
treef55f3a08b965e9323073748205e8e8b5ef98ee30
parent4b1f5b73e060971c434e70694d571adfee553027
vfio/container: ram discard disable helper

Define a helper to set ram discard disable, generate error messages,
and cleanup on failure.  The second vfio_ram_block_discard_disable
call site now performs VFIO_GROUP_UNSET_CONTAINER immediately on failure,
instead of relying on the close of the container fd to do so in the kernel,
but this is equivalent.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Cedric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/1746195760-101443-2-git-send-email-steven.sistare@oracle.com
[ clg: vfio_attach_discard_disable() -> vfio_container_attach_discard_disable() ]
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/container.c