Skip to content

Commit 66f3013

Browse files
committed
doc: update MockSplitQueue helper method docs to reflect API changes
Signed-off-by: Nelson Wong <[email protected]>
1 parent a752c47 commit 66f3013

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

virtio-queue/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,17 @@ following ones:
151151
* `AvailIter` - is a consuming iterator over all available descriptor chain
152152
heads in the queue.
153153

154+
### Queue helper methods
155+
156+
To help with directly manipulating the memory backing a queue, the test utilities expose a set of convenience methods:
157+
158+
* `load_idx` / `store_idx` – read or write the ring `idx` field.
159+
* `load_ring_entry` / `store_ring_entry` – read or write individual ring entries.
160+
* `load_flags` / `store_flags` and `load_event` / `store_event` – access the auxiliary fields of the rings.
161+
* `start` / `end` – get the guest address range covered by the ring.
162+
163+
These helpers are available on the objects returned by the `avail()` and `used()` accessors provided by `MockSplitQueue` and make it easy to set up a queue in tests or simple examples.
164+
154165
## Save/Restore Queue
155166

156167
The `Queue` allows saving the state through the `state` function which returns

0 commit comments

Comments
 (0)