Crate machina_virtio_device

Source
Expand description

Write Machina virtio devices in Rust.

This crate aims to simplify the writing of virtio devices as out of process FIDL services by automating boiler plate and providing common wrappers for Machina/Fuchsia specifics.

The primary helper is the Device object that wraps most of the common other helpers, and this must be constructed via the DeviceBuilder, although any of the individual helpers can be used independently without Device if desired.

Structs§

Device
State for managing a virtio device and its queues using futures.
DeviceBuilder
Helper to process device messages and build a Device
GuestBellTrap
Wrapper for receiving bell traps from the guest.
GuestMem
Provide access to guest memory.
NotifyEvent
Wraps a zx::Event and implements [DriverNotify]
QueueConfig
Raw queue configuration from a VirtioDeviceRequest::ConfigureQueue
WrappedDescChainStream
Wrapper around a [DescChainStream]

Enums§

BellError
DeviceError

Traits§

QueueCheck
Describes the queues that are expected and valid for a device

Functions§

builder_from_start_info
Construct a DeviceBuilder from the provided StartInfo
config_builder_from_stream
Process a VirtioDeviceRequestStream to configure all the queues.
from_start_info
Construct a DeviceBuilder and GuestMem from the provided StartInfo
guest_mem_from_vmo
Construct a new GuestMem containing the given zx::Vmo
translate_queue
Helper for constructing a [QueueMemory]