cloudhypervisor module #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Cloud Hypervisor implementation for , providing a modern, secure, and lightweight VMM built on Rust with focus on cloud workloads and security.
Functionality
Module API
Cloud Hypervisor Runtime
CloudHypervisorRuntime::new(config: CloudHypervisorConfig) -> Result<Self, CloudHypervisorError>- Create runtimeCloudHypervisorRuntime::create_vm(&self, spec: VMSpec) -> Result<VMHandle, CloudHypervisorError>- Create VMCloudHypervisorRuntime::start_vm(&self, handle: &VMHandle) -> Result<(), CloudHypervisorError>- Start VMCloudHypervisorRuntime::stop_vm(&self, handle: &VMHandle, force: bool) -> Result<(), CloudHypervisorError>- Stop VMCloudHypervisorRuntime::pause_vm(&self, handle: &VMHandle) -> Result<(), CloudHypervisorError>- Pause VMCloudHypervisorRuntime::resume_vm(&self, handle: &VMHandle) -> Result<(), CloudHypervisorError>- Resume VMCloudHypervisorRuntime::reset_vm(&self, handle: &VMHandle) -> Result<(), CloudHypervisorError>- Reset VMCloudHypervisorRuntime::resize_memory(&self, handle: &VMHandle, size: u64) -> Result<(), CloudHypervisorError>- Resize memoryCloudHypervisorRuntime::add_vcpu(&self, handle: &VMHandle, count: u32) -> Result<(), CloudHypervisorError>- Add vCPUCloudHypervisorRuntime::remove_vcpu(&self, handle: &VMHandle, count: u32) -> Result<(), CloudHypervisorError>- Remove vCPUCloudHypervisorRuntime::get_vm_status(&self, handle: &VMHandle) -> Result<VMStatus, CloudHypervisorError>- Get statusCloud Hypervisor Process Management
CloudHypervisorProcess::new(binary: &str) -> Result<Self, CloudHypervisorError>- Create processCloudHypervisorProcess::with_api_socket(socket: &str) -> Self- Set API socketCloudHypervisorProcess::with_log_file(file: &str) -> Self- Set log fileCloudHypervisorProcess::start(&mut self) -> Result<(), CloudHypervisorError>- Start processCloudHypervisorProcess::stop(&mut self) -> Result<(), CloudHypervisorError>- Stop processCloudHypervisorProcess::wait(&self) -> Result<ExitStatus, CloudHypervisorError>- Wait for exitVM Configuration
VMConfig::new() -> Self- Create VM configVMConfig::with_kernel(path: &str) -> Self- Set kernel pathVMConfig::with_initramfs(path: &str) -> Self- Set initramfs pathVMConfig::with_cmdline(args: Vec<&str>) -> Self- Set kernel cmdlineVMConfig::with_cpus(cpus: u32) -> Self- Set CPU countVMConfig::with_memory(size: u64) -> Self- Set memory sizeVMConfig::with_rng(src: RngSource) -> Self- Set RNG sourceVMConfig::build() -> VMSpec- Build specDevice Management
add_virtio_blk(&mut self, path: &Path, readonly: bool) -> &mut Self- Add block deviceadd_virtio_net(&mut self, tap: &str) -> &mut Self- Add network deviceadd_virtio_rng(&mut self) -> &mut Self- Add RNG deviceadd_virtio_fs(&mut self, tag: &str, path: &Path) -> &mut Self- Add fs deviceadd_vhost_user_net(&mut self, socket: &str) -> &mut Self- Add vhost-user netadd_vhost_user_blk(&mut self, socket: &str) -> &mut Self- Add vhost-user blkadd_vfio(&mut self, device: &str) -> &mut Self- Add VFIO deviceSnapshot/Restore
create_snapshot(&self, vm_id: &str, path: &Path) -> Result<(), CloudHypervisorError>- Create snapshotrestore_snapshot(&self, path: &Path) -> Result<VMHandle, CloudHypervisorError>- Restore snapshotlist_snapshots(&self, vm_id: &str) -> Result<Vec<SnapshotInfo>, CloudHypervisorError>- List snapshotsdelete_snapshot(&self, vm_id: &str, name: &str) -> Result<(), CloudHypervisorError>- Delete snapshotAPI Client
APIClient::new(socket: &Path) -> Result<Self, CloudHypervisorError>- Create API clientAPIClient::vm_create(&self, config: VMConfig) -> Result<String, CloudHypervisorError>- Create VMAPIClient::vm_boot(&self, vm_id: &str) -> Result<(), CloudHypervisorError>- Boot VMAPIClient::vm_info(&self, vm_id: &str) -> Result<VMInfo, CloudHypervisorError>- Get VM infoAPIClient::vm_delete(&self, vm_id: &str) -> Result<(), CloudHypervisorError>- Delete VMAPIClient::vm_resize(&self, vm_id: &str, size: u64) -> Result<(), CloudHypervisorError>- Resize VMAPIClient::vm_add_device(&self, vm_id: &str, device: DeviceConfig) -> Result<(), CloudHypervisorError>- Add deviceAPIClient::vm_remove_device(&self, vm_id: &str, device: &str) -> Result<(), CloudHypervisorError>- Remove devicedon't try to do all phase 1 focus on what we need for our usecases
usecase
requirementd
also use the builder pattern