virtqueue_resize(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ virtqueue_resize β€” Kernel API Manual ✨

Okay bestie, this is the virtqueue_resize(9) page, and we're about to make vring resizing make sense πŸ’… No cap, it's a whole main-character operation.


🌸 NAME 🌸

virtqueue_resize β€” resize the vring of vq πŸ¦‹


✨ SYNOPSIS ✨

       int virtqueue_resize (struct virtqueue *_vq , u32 num , void
       (*recycle)(struct virtqueue *vq, void *buf) , void
       (*recycle_done)(struct virtqueue *vq) );

πŸŽ€ ARGUMENTS πŸŽ€

  • _vq β€” the struct virtqueue we're talking about. That's the one, bestie.
  • num β€” new ring num.
  • recycle β€” callback to recycle unused buffers.
  • recycle_done β€” callback to be invoked when recycle for all unused buffers done.

πŸ’– DESCRIPTION πŸ’–

When it is really necessary to create a new vring, it will set the current vq into the reset state. Then call the passed callback to recycle the buffer that is no longer used. Only after the new vring is successfully created, the old vring will be released.

Caller must ensure we don't call this with other virtqueue operations at the same time (except where noted).

Returns zero or a negative error.

  • 0 β€” success.
  • -ENOMEM β€” Failed to allocate a new ring, fall back to the original ring size. vq can still work normally.
  • -EBUSY β€” Failed to sync with device, vq may not work properly.
  • -ENOENT β€” Transport or device not supported.
  • -E2BIG/-EINVAL β€” num error.
  • -EPERM β€” Operation not permitted.

πŸ‘€ SEE ALSO πŸ‘€

Kernel file: ./drivers/virtio/virtio_ring.c


Signed off from source/version ./drivers/virtio Β· dated October 2026 Β· virtqueue_resize(9) β€” bye bestie, slay your vrings πŸ’…βœ¨

πŸ“¦ where this page comes from