STRUCT VFIO_MIGRATION_OPS(9)
β¨ struct vfio_migration_ops(9) β¨
okay bestie, welcome to the Kernel API Manual π this little page is all about struct vfio_migration_ops and honestly? it's giving "backstage pass to migration" energy π
π NAME
struct vfio_migration_ops β the VFIO bus device driver migration callbacks π like, these are the lil functions your driver hands over so migration can actually happen.
πΈ SYNOPSIS
struct vfio_migration_ops {
struct file *(*migration_set_state)( struct vfio_device *device,
enum vfio_device_mig_state new_state);
int (*migration_get_state)(struct vfio_device *device, enum
vfio_device_mig_state *curr_state);
int (*migration_get_data_size)(struct vfio_device *device, unsigned
long *stop_copy_length);
};
no cap, that's the whole struct π«Ά three function pointers, each one optional-but-actually-mandatory-if-you-want-migration (more on that in a sec π).
π¦ Members
migration_set_stateβ an optional callback that changes the migration state for devices that support migration β¨. it is mandatory forVFIO_DEVICE_FEATURE_MIGRATIONmigration support, so likeβ¦ optional in theory, required in practice, iykyk π. the returned FD is used for data transfer according to the FSM definition π¨. and the driver is responsible for making sure that FD reaches end of stream or error whenever the migration FSM leaves a data transfer state, or beforeclose_devicereturns π¨ β yes, that's on you, bestie, no dodging it.migration_get_stateβ an optional callback that gets the migration state for devices that support migration π. also mandatory forVFIO_DEVICE_FEATURE_MIGRATIONmigration support. the way it just peeks at where you're at, iconic.migration_get_data_sizeβ an optional callback that gets the estimated data length that will be required to complete stop copy π. and yup, you guessed it: mandatory forVFIO_DEVICE_FEATURE_MIGRATIONmigration support π₯.
π SEE ALSO
- Kernel file
./include/linux/vfio.h struct vfio_device_ops(9)struct vfio_log_ops(9)vfio_check_feature(9)vfio_check_precopy_ioctl(9)
go read those too, they're lowkey the whole friend group π
fr fr, remember the vibe check: all three callbacks say "Optional" in the description, but every single one is mandatory for VFIO_DEVICE_FEATURE_MIGRATION migration support. don't let the word "optional" gaslight you π
okay that's the page!! tysm for reading, mwah π this one came from ./include/linux, dated October 2026 β literally a little time capsule, slay βπ§ββοΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms