Crate crosvm_control
source ·Expand description
Provides parts of crosvm as a library to communicate with running crosvm instances.
This crate is a programmatic alternative to invoking crosvm with subcommands that produce the result on stdout.
Downstream projects rely on this library maintaining a stable API surface. Do not make changes to this library without consulting the crosvm externalization team. Email: crosvm-dev@chromium.org
The API of this library should remain the same regardless of which crosvm features are enabled. Any missing functionality should be handled by returning an error at runtime, not conditional compilation, so that users can rely on the the same set of functions with the same prototypes regardless of how crosvm is configured.
For more information see: https://crosvm.dev/book/running_crosvm/programmatic_interaction.html#usage
Structs§
- Similar to internally used
BalloonStats
but usingi64
instead ofOption<u64>
.None
(or values bigger thani64::max
) will be encoded as -1. - Publically exposed version of RegisteredEvent enum, implemented as an integral newtype for FFI safety.
- Arguments structure for crosvm_client_swap_disable_vm2.
- The response to
crosvm swap status
command. - Represents an individual attached USB device.
- Externally exposed variant of BalloonWS/WSBucket, used for FFI.
Constants§
Functions§
- Returns balloon stats of the crosvm instance whose control socket is listening on
socket_path
. - Safety
- See crosvm_client_balloon_stats.
- Adjusts the balloon size of the crosvm instance whose control socket is listening on
socket_path
. - See crosvm_client_balloon_vms.
- Returns balloon working set of the crosvm instance whose control socket is listening on socket_path.
- Set Working Set Reporting config in guest.
- Resume the battery status of crosvm instance from fake status
- Fakes the battery status of crosvm instance. The power status will always be on battery, and the maximum battery capacity could be read by guest is set to the
max_battery_capacity
. - Creates an RT vCPU for the crosvm instance whose control socket is listening on
socket_path
. - Simply returns the maximum possible number of USB devices
- Modifies the battery status of crosvm instance whose control socket is listening on
socket_path
. - Attaches a net tap device to the crosvm instance with control socket at
socket_path
. - Detaches a hotplugged tap device from the crosvm instance with control socket at
socket_path
. - Registers the connected process as a listener for
event
. - Resizes the disk of the crosvm instance whose control socket is listening on
socket_path
. - Resumes the crosvm instance whose control socket is listening on
socket_path
. - Resumes the crosvm instance whose control socket is listening on
socket_path
. - Attaches a u2f security key to crosvm instance whose control socket is listening on
socket_path
. - Stops the crosvm instance whose control socket is listening on
socket_path
. - Suspends the crosvm instance whose control socket is listening on
socket_path
. - Disable vmm swap according to
args
. - Enable vmm swap for crosvm instance whose control socket is listening on
socket_path
. - Returns vmm-swap status of the crosvm instance whose control socket is listening on
socket_path
. - Swap out staging memory for crosvm instance whose control socket is listening on
socket_path
. - Trim staging memory for vmm swap for crosvm instance whose control socket is listening on
socket_path
. - Unegisters the connected process as a listener for
event
. - Unegisters the connected process as a listener for all events.
- Attaches an USB device to crosvm instance whose control socket is listening on
socket_path
. - Detaches an USB device from crosvm instance whose control socket is listening on
socket_path
.port
determines device to be detached. - Returns all USB devices passed through the crosvm instance whose control socket is listening on
socket_path
. - Safety