mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-07 12:29:56 +00:00
Merge pull request #6096 from dcantah/kataruntime-use_hyp_consts
runtime: Use consts in `kata-runtime check`
This commit is contained in:
commit
421a33f846
@ -115,13 +115,13 @@ func setCPUtype(hypervisorType vc.HypervisorType) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch hypervisorType {
|
switch hypervisorType {
|
||||||
case "firecracker":
|
case vc.FirecrackerHypervisor:
|
||||||
fallthrough
|
fallthrough
|
||||||
case "clh":
|
case vc.ClhHypervisor:
|
||||||
fallthrough
|
fallthrough
|
||||||
case "dragonball":
|
case vc.DragonballHypervisor:
|
||||||
fallthrough
|
fallthrough
|
||||||
case "qemu":
|
case vc.QemuHypervisor:
|
||||||
archRequiredCPUFlags = map[string]string{
|
archRequiredCPUFlags = map[string]string{
|
||||||
cpuFlagVMX: "Virtualization support",
|
cpuFlagVMX: "Virtualization support",
|
||||||
cpuFlagLM: "64Bit CPU",
|
cpuFlagLM: "64Bit CPU",
|
||||||
@ -153,7 +153,7 @@ func setCPUtype(hypervisorType vc.HypervisorType) error {
|
|||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
case "acrn":
|
case vc.AcrnHypervisor:
|
||||||
archRequiredCPUFlags = map[string]string{
|
archRequiredCPUFlags = map[string]string{
|
||||||
cpuFlagLM: "64Bit CPU",
|
cpuFlagLM: "64Bit CPU",
|
||||||
cpuFlagSSE4_1: "SSE4.1",
|
cpuFlagSSE4_1: "SSE4.1",
|
||||||
@ -175,7 +175,7 @@ func setCPUtype(hypervisorType vc.HypervisorType) error {
|
|||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
case "mock":
|
case vc.MockHypervisor:
|
||||||
archRequiredCPUFlags = map[string]string{
|
archRequiredCPUFlags = map[string]string{
|
||||||
cpuFlagVMX: "Virtualization support",
|
cpuFlagVMX: "Virtualization support",
|
||||||
cpuFlagLM: "64Bit CPU",
|
cpuFlagLM: "64Bit CPU",
|
||||||
@ -310,17 +310,16 @@ func acrnIsUsable() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func archHostCanCreateVMContainer(hypervisorType vc.HypervisorType) error {
|
func archHostCanCreateVMContainer(hypervisorType vc.HypervisorType) error {
|
||||||
|
|
||||||
switch hypervisorType {
|
switch hypervisorType {
|
||||||
case "qemu":
|
case vc.QemuHypervisor:
|
||||||
fallthrough
|
fallthrough
|
||||||
case "clh":
|
case vc.ClhHypervisor:
|
||||||
fallthrough
|
fallthrough
|
||||||
case "firecracker":
|
case vc.FirecrackerHypervisor:
|
||||||
return kvmIsUsable()
|
return kvmIsUsable()
|
||||||
case "acrn":
|
case vc.AcrnHypervisor:
|
||||||
return acrnIsUsable()
|
return acrnIsUsable()
|
||||||
case "mock":
|
case vc.MockHypervisor:
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("archHostCanCreateVMContainer: Unknown hypervisor type %s", hypervisorType)
|
return fmt.Errorf("archHostCanCreateVMContainer: Unknown hypervisor type %s", hypervisorType)
|
||||||
|
Loading…
Reference in New Issue
Block a user