forked from firecracker-microvm/firecracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devices/virtio: new virtq manipulation pattern
Added a new VirtIO queue manipulation pattern, without the use of the currently employed available chain iterator. Available descriptor chains can now be popped straight from the queue. New virtq methods: - `pop()` - pop the first available descriptor chain from the avail ring; - `undo_pop()` - undo the last `pop()`; - `len()` - get the number of available descriptor chains; - `is_empty()` - check if there are any available descriptor chains. This is the first step in eliminating the virtq available chains iterator. This iterator holds a mutable reference to the queue, which hinders the get_avail/add_used cycle. Various methods are currently employed to bypass this limitation, including re-creating the iterator at each iteration step. Future commits will remove this usage pattern. Signed-off-by: Dan Horobeanu <[email protected]>
- Loading branch information
Showing
1 changed file
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters