Expand description
Shared test helpers for writing integration tests that drive virtio devices through descriptor rings.
These helpers manipulate split virtqueue descriptor tables, available rings, and used rings in guest memory — the same operations a guest driver would perform.
Functions§
- init_
avail_ ring - Initialize an avail ring (flags=0, idx=0).
- init_
used_ ring - Initialize a used ring (flags=0, idx=0).
- make_
available - Make a descriptor index available in the avail ring and bump the index.
- read_
used - Read the next used ring entry, returning
(desc_id, bytes_written)orNoneif no new entries are available. - read_
used_ entry - Read a used ring entry (id, len) at the given ring index.
- read_
used_ idx - Read the used ring index.
- wait_
for_ used - Wait for the next used ring entry, polling with a timeout.
- write_
descriptor - Write a split virtio descriptor at the given descriptor table base.