rproc_add_virtio_dev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rproc_add_virtio_dev(9) πŸ’…

okay so before we even get into it β€” hi bestie, welcome to the Kernel API Manual ✨ this one's a short one but it's kind of a big deal, no cap. it's giving "tiny function, main character energy" πŸŽ€


🌸 NAME 🌸

rproc_add_virtio_dev β€” registers an rproc-induced virtio device πŸ¦‹

like, it's the function that literally makes the virtio device show up. iconic behavior tbh πŸ‘‘


✨ SYNOPSIS ✨

int rproc_add_virtio_dev (struct rproc_vdev *rvdev , int id );

that's it. two args. she's simple, she's clean, she slays πŸ’…


🫢 ARGUMENTS 🫢

  • rvdev β€” the remote vdev πŸ’– this is the remote virtio device struct you're handing over, bestie, and yes it needs to be a struct rproc_vdev *.
  • id β€” the device type identification πŸ”₯ and like, its whole job is to match the device up with a driver. that's the matchmaking moment. iykyk πŸ’« (it's an int, before you ask)

🧚 DESCRIPTION 🧚

so what does it actually do? it registers a virtio device ✨ that's the whole vibe. one job, done well, periodt.

and the little detail that matters: this vdev's parent is the rproc device πŸ‘‘ like the rproc is the parent and the vdev is the baby, the family tree is intact, we love a functional household 🌈


⭐ RETURN ⭐

  • 0 on success πŸŽ‰ (the slay case)
  • or an appropriate error value otherwise πŸ’€ (the "oop" case β€” check it, don't just assume you ate)

πŸ‘€ SEE ALSO πŸ‘€

  • Kernel file ./drivers/remoteproc/remoteproc_virtio.c β€” go read the source, bestie, it's literally right there πŸ“
  • rproc_vq_interrupt(9) β€” the interrupt one πŸ¦‹
  • rproc_remove_virtio_dev(9) β€” the one that undoes this one 😭 (every add has its remove, that's just life)

okay that's the whole thing!! short, sweet, and honestly kind of a baddie πŸ§šπŸ’œ

sign-off time: this little beauty lives in ./drivers/remoteproc, dated October 2026 πŸŽ€ mwah, go register some virtio devices responsibly, ily πŸ’–βœ¨

πŸ“¦ where this page comes from