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Β§
- Balloon
Tube - Utility for multiplexing a balloon tube between multiple control tubes. Commands are sent and processed serially.
- BatControl
- Used for VM to control battery properties.
- Device
Sleep Guard - A guard to guarantee that all devices are sleeping during its scope.
- Flat
VmMemory πResponse Error - HotPlug
Device Info - IoEvent
Update Request - Request to register or unregister an ioevent.
- Rutabaga
Memory πRegion - UsbControl
Attached Device - Vcpu
Restore Request - Request to restore a Vcpu from a given snapshot, and report the results back via the provided channel.
- Vcpu
Suspend Guard - A guard to guarantee that all the vCPUs are suspended during the scope.
- VmMapped
Memory Region - VmMemory
File Mapping - Request to mmap a file to a shared memory.
This request is supposed to follow a
VmMemoryRequest::MmapAndRegisterMemoryrequest that containsSharedMemorythatfileis mmaped to. - VmMemory
Region Id - Identifer for registered memory regions. Globally unique.
- VmMemory
Region State - VmMemory
Request Iommu Client - Struct for managing
VmMemoryRequests IOMMU related state. - VmMemory
Response Error
EnumsΒ§
- Balloon
Control Command - BatControl
Command - BatControl
Result - BatHealth
- BatProperty
- BatStatus
- Battery
Type - Device
Control Command - Commands for actions on devices and the devices control thread.
- Devices
State - Disk
Control Command - Disk
Control Result - GpuSend
ToMain - GpuSend
ToService - HotPlug
Device Type - IrqHandler
Request - Commands to control the IRQ handler thread.
- IrqHandler
Response - Response for IrqHandlerRequest.
- IrqSetup
- Data to set up an IRQ event or IRQ route on the IRQ chip.
VmIrqRequest::execute canβt take an
IrqChipargument, because of a dependency cycle between devices and vm_control, so it takes a Fn that processes anIrqSetup. - Modify
Wait Context - Enum that allows remote control of a wait context (used between the Windows GpuDisplay & the GPU worker).
- NetControl
Command - Net control commands for adding and removing tap devices.
- PciControl
Result - Result for hotplug and removal of PCI device.
- PvClock
Command - Message for communicating a suspend or resume to the virtio-pvclock device.
- PvClock
Command Response - Message used by virtio-pvclock to communicate command results.
- Registered
Event - NOTE: when making any changes to this enum please also update RegisteredEventFfi in crosvm_control/src/lib.rs
- Registered
Event With Data - Registered
Memory π - Service
Send ToGpu - Snapshot
Command - Commands for snapshot feature
- SndControl
Command - Used for VM to control for virtio-snd
- Swap
Command - Commands for vmm-swap feature
- UsbControl
Command - UsbControl
Result - Vcpu
Control - Control the state of a particular VM CPU.
- VirtioIOMMU
Request - A request to the virtio-iommu process to perform some operations.
- VirtioIOMMU
Response - Indication of success or failure of a
VirtioIOMMURequest. - VirtioIOMMU
Vfio Command - VirtioIOMMU
Vfio Error - VirtioIOMMU
Vfio Result - VmIrq
Request - VmIrq
Response - VmMemory
Destination - Destination of a
VmMemoryRequest::RegisterMemorymapping in guest address space. - VmMemory
Request - VmMemory
Response - VmMemory
Source - Source of a
VmMemoryRequest::RegisterMemorymapping. - VmRequest
- A request to the main process to perform some operation on the VM.
- VmResponse
- Indication of success or failure of a
VmRequest. - VmRun
Mode - 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Β§
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Β§
- Hypervisor
Kind - MemSlot
- An index in the list of guest-mapped memory regions.
- VirtioIOMMU
Request Result