Crate vm_control

Source
Expand description

Handles IPC for controlling the main VM process.

The VM Control IPC protocol is synchronous, meaning that each VmRequest sent over a connection will receive a VmResponse for that request next time data is received over that connection.

The wire message format is a little-endian C-struct of fixed size, along with a file descriptor if the request type expects one.

Re-exportsΒ§

pub use sys::FsMappingRequest;
pub use sys::VmMemoryMappingRequest;
pub use sys::VmMemoryMappingResponse;
pub use crate::gdb::VcpuDebug;
pub use crate::gdb::VcpuDebugStatus;
pub use crate::gdb::VcpuDebugStatusMessage;

ModulesΒ§

api
vm_control API client for use within crosvm
balloon_tube πŸ”’
Balloon related control APIs.
client
gdb
gpu
sys

StructsΒ§

BalloonTube
Utility for multiplexing a balloon tube between multiple control tubes. Commands are sent and processed serially.
BatControl
Used for VM to control battery properties.
DeviceSleepGuard
A guard to guarantee that all devices are sleeping during its scope.
FlatVmMemoryResponseError πŸ”’
HotPlugDeviceInfo
IoEventUpdateRequest
Request to register or unregister an ioevent.
RutabagaMemoryRegion πŸ”’
UsbControlAttachedDevice
VcpuRestoreRequest
Request to restore a Vcpu from a given snapshot, and report the results back via the provided channel.
VcpuSuspendGuard
A guard to guarantee that all the vCPUs are suspended during the scope.
VmMappedMemoryRegion
VmMemoryFileMapping
Request to mmap a file to a shared memory. This request is supposed to follow a VmMemoryRequest::MmapAndRegisterMemory request that contains SharedMemory that file is mmaped to.
VmMemoryRegionId
Identifer for registered memory regions. Globally unique.
VmMemoryRegionState
VmMemoryRequestIommuClient
Struct for managing VmMemoryRequests IOMMU related state.
VmMemoryResponseError

EnumsΒ§

BalloonControlCommand
BatControlCommand
BatControlResult
BatHealth
BatProperty
BatStatus
BatteryType
DeviceControlCommand
Commands for actions on devices and the devices control thread.
DevicesState
DiskControlCommand
DiskControlResult
GpuSendToMain
GpuSendToService
HotPlugDeviceType
IrqHandlerRequest
Commands to control the IRQ handler thread.
IrqHandlerResponse
Response for IrqHandlerRequest.
IrqSetup
Data to set up an IRQ event or IRQ route on the IRQ chip. VmIrqRequest::execute can’t take an IrqChip argument, because of a dependency cycle between devices and vm_control, so it takes a Fn that processes an IrqSetup.
ModifyWaitContext
Enum that allows remote control of a wait context (used between the Windows GpuDisplay & the GPU worker).
NetControlCommand
Net control commands for adding and removing tap devices.
PciControlResult
Result for hotplug and removal of PCI device.
PvClockCommand
Message for communicating a suspend or resume to the virtio-pvclock device.
PvClockCommandResponse
Message used by virtio-pvclock to communicate command results.
RegisteredEvent
NOTE: when making any changes to this enum please also update RegisteredEventFfi in crosvm_control/src/lib.rs
RegisteredEventWithData
RegisteredMemory πŸ”’
ServiceSendToGpu
SnapshotCommand
Commands for snapshot feature
SndControlCommand
Used for VM to control for virtio-snd
SwapCommand
Commands for vmm-swap feature
UsbControlCommand
UsbControlResult
VcpuControl
Control the state of a particular VM CPU.
VirtioIOMMURequest
A request to the virtio-iommu process to perform some operations.
VirtioIOMMUResponse
Indication of success or failure of a VirtioIOMMURequest.
VirtioIOMMUVfioCommand
VirtioIOMMUVfioError
VirtioIOMMUVfioResult
VmIrqRequest
VmIrqResponse
VmMemoryDestination
Destination of a VmMemoryRequest::RegisterMemory mapping in guest address space.
VmMemoryRequest
VmMemoryResponse
VmMemorySource
Source of a VmMemoryRequest::RegisterMemory mapping.
VmRequest
A request to the main process to perform some operation on the VM.
VmResponse
Indication of success or failure of a VmRequest.
VmRunMode
Mode of execution for the VM.

ConstantsΒ§

EXPECTED_MAX_IRQ_FLUSH_ITERATIONS πŸ”’
USB_CONTROL_MAX_PORTS
The maximum number of devices that can be listed in one UsbControlCommand.

TraitsΒ§

GpeNotify
PmResource
PmeNotify

FunctionsΒ§

do_restore
Restore the VM to the snapshot at restore_path.
do_snapshot πŸ”’
Snapshot the VM to file at snapshot_path
get_vcpu_state πŸ”’
handle_disk_command
map_descriptor πŸ”’
WARNING: descriptor must be a mapping handle on Windows.
to_rutabaga_desciptor πŸ”’
try_map_to_prepared_region πŸ”’
virtio_iommu_request
Send VirtioIOMMURequest and wait to get the response
virtio_iommu_request_async
Send VirtioIOMMURequest without waiting for the response

Type AliasesΒ§

HypervisorKind
MemSlot
An index in the list of guest-mapped memory regions.
VirtioIOMMURequestResult