virt-what module #11
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_lib#11
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?
Module Overview
The virt-what module provides virtualization environment detection capabilities for , enabling the system to identify and characterize the virtualization layer, hypervisor type, and container technologies in use. This information is crucial for optimizing performance, selecting appropriate drivers, and configuring workloads correctly based on the underlying virtualization stack.
The module combines multiple detection techniques including CPUID inspection, hypervisor signatures, filesystem analysis, and system file examination to accurately identify virtualization environments. It can distinguish between bare metal, various hypervisors, container technologies, and cloud provider environments, providing with the context needed for optimal operation.
Functionality
Module API
Hypervisor Detection
VirtDetector::new() -> Self- Create a new virtualization detectordetect_hypervisor() -> Result<Option<HypervisorType>, VirtError>- Detect the hypervisor typeis_running_in_vm() -> Result<bool, VirtError>- Check if running in a virtual machineget_hypervisor_info() -> Result<HypervisorInfo, VirtError>- Get detailed hypervisor informationdetect_kvm() -> Result<bool, VirtError>- Detect KVM hypervisor presenceContainer Detection
detect_container() -> Result<Option<ContainerType>, VirtError>- Detect container runtimeis_running_in_container() -> Result<bool, VirtError>- Check if running in containerget_container_info() -> Result<ContainerInfo, VirtError>- Get container environment detailsdetect_docker() -> Result<bool, VirtError>- Detect Docker container runtimedetect_podman() -> Result<bool, VirtError>- Detect Podman container runtimedetect_lxc() -> Result<bool, VirtError>- Detect LXC container technologyget_container_id() -> Result<Option<String>, VirtError>- Extract container IDHardware Virtualization
check_hardware_virtualization() -> Result<VirtSupport, VirtError>- Check hardware supportcheck_nested_virtualization() -> Result<bool, VirtError>- Check nested virtualizationget_virt_features() -> Result<Vec<VirtFeature>, VirtError>- Get virtualization featurescheck_iommu_support() -> Result<bool, VirtError>- Check IOMMU availabilitycheck_vt_x() -> Result<bool, VirtError>- Check Intel VT-x supportcheck_amd_v() -> Result<bool, VirtError>- Check AMD-V supportget_cpu_flags() -> Result<Vec<String>, VirtError>- Get CPU virtualization flags