STRUCT VFIO_MIGRATION_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 for VFIO_DEVICE_FEATURE_MIGRATION migration 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 before close_device returns 🚨 β€” 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 for VFIO_DEVICE_FEATURE_MIGRATION migration 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 for VFIO_DEVICE_FEATURE_MIGRATION migration support πŸ”₯.

πŸŽ€ SEE ALSO

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