]> git.ipfire.org Git - thirdparty/qemu.git/commit
vfio/container: preserve descriptors
authorSteve Sistare <steven.sistare@oracle.com>
Tue, 10 Jun 2025 15:39:17 +0000 (08:39 -0700)
committerCédric Le Goater <clg@redhat.com>
Wed, 11 Jun 2025 12:01:58 +0000 (14:01 +0200)
commitc29a65ed68535288551d2bf70ae32f3df371a57d
tree59548081eb53b45ba7353e06d6c5f40e0a17d92c
parent54857b08168a0a74711d1f773c16a7122499027b
vfio/container: preserve descriptors

At vfio creation time, save the value of vfio container, group, and device
descriptors in CPR state.  On qemu restart, vfio_realize() finds and uses
the saved descriptors.

During reuse, device and iommu state is already configured, so operations
in vfio_realize that would modify the configuration, such as vfio ioctl's,
are skipped.  The result is that vfio_realize constructs qemu data
structures that reflect the current state of the device.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Link: https://lore.kernel.org/qemu-devel/1749569991-25171-5-git-send-email-steven.sistare@oracle.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/container.c
hw/vfio/cpr-legacy.c
include/hw/vfio/vfio-cpr.h