virtqueue_reset(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… virtqueue_reset(9) β€” it's giving Kernel API Manual, bestie πŸ¦‹

okay so picture this: you're deep in the kernel, you've got a struct virtqueue that's holding onto a bunch of buffers nobody's using anymore, and you just want to, like, let them go. that's this function. welcome to the reset arc, it's very main character energy ✨


🌸 NAME 🌸

virtqueue_reset β€” detach and recycle all unused buffers πŸ’–


✨ SYNOPSIS ✨

int virtqueue_reset (struct virtqueue *_vq , void (*recycle)(struct
virtqueue *vq, void *buf) , void (*recycle_done)(struct virtqueue *vq)
);

like, look at that signature. three whole params. she's committed πŸŽ€


🫢 ARGUMENTS 🫢

  • _vq β€” the struct virtqueue we're talking about. yes, the underscore is part of the name, don't come for her πŸ’…
  • recycle β€” callback to recycle unused buffers. this is where you get to be the recycling icon you were always meant to be ♻️
  • recycle_done β€” callback that gets invoked when the recycling of all the unused buffers is done. the "we're so back" moment, fr fr 🌈

πŸ’€ DESCRIPTION πŸ’€

okay so the caller must ensure we don't call this with other virtqueue operations at the same time β€” except where noted. that's a big deal, not me being dramatic. do not overlap this with other vq ops unless the docs literally told you it's fine πŸ™ˆ

returns zero or a negative error, and here's the full receipt:

  • 0 β€” success. slay πŸ’… periodt
  • -EBUSY β€” failed to sync with device, and vq may not work properly 😭 like it might be cooked, ngl
  • -ENOENT β€” transport or device not supported 🫠
  • -EPERM β€” operation not permitted πŸ”₯
warning bestie: that -EBUSY one is the scary one β€” if you hit it, the vq may not work properly. not a vibe. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./drivers/virtio/virtio_ring.c β€” that's where the magic lives, iykyk 🧚

and the whole friend group, because she does not go anywhere alone:

thirty-one entries and every single one of them still invited, no gatekeeping here πŸŽ€


and that's the whole page, bestie 🫢 this drop is from ./drivers/virtio, dated October 2026, and it lives in the Kernel API Manual β€” go forth, detach those unused buffers, and recycle responsibly βœ¨πŸ’–

πŸ“¦ where this page comes from