You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: virtio-queue/README.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,6 +151,17 @@ following ones:
151
151
*`AvailIter` - is a consuming iterator over all available descriptor chain
152
152
heads in the queue.
153
153
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
+
154
165
## Save/Restore Queue
155
166
156
167
The `Queue` allows saving the state through the `state` function which returns
0 commit comments