Crate crosvm_plugin
source Β·Expand description
This module implements the dynamically loaded client library API used by a crosvm plugin,
defined in crosvm.h
. It implements the client half of the plugin protocol, which is defined in
the protos::plugin
module.
To implement the crosvm.h
C API, each function and struct definition is repeated here, with
concrete definitions for each struct. Most functions are thin shims to the underlying object
oriented Rust implementation method. Most methods require a request over the crosvm connection,
which is done by creating a MainRequest
or VcpuRequest
protobuf and sending it over the
connectionβs socket. Then, that socket is read for a MainResponse
or VcpuResponse
, which is
translated to the appropriate return type for the C API.
MacrosΒ§
- impl_ctor_dtor πThis helper macro implements the C APIβs constructor/destructor for a given type. Because they all follow the same pattern and include lots of boilerplate unsafe code, it makes sense to write it once with this helper macro.
StructsΒ§
- IdAllocator π
- anon_hyperv_call π
- anon_hyperv_synic π
- anon_io_access π
EnumsΒ§
ConstantsΒ§
- CROSVM_HINT_ON_WRITE π
- CROSVM_IRQ_ROUTE_MSI π
- MAX_DATAGRAM_FD π
- MAX_DATAGRAM_SIZE π
FunctionsΒ§
- fd_cast π
- printstats π
- proto_error_to_int π
- read_varint32 π
- record π
- to_crosvm_rc π
UnionsΒ§
- anon_vcpu_event π