mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-02 02:02:24 +00:00
virtcontainers: Add firecracker as a supported hypervisor
Add firecracker as a supported hypervisor. This connects the newly defined firecracker implementation as a supported hypervisor. Move operation definition to the common hypervisor code. Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
This commit is contained in:
parent
c1d3f1a98b
commit
e65bafa793
@ -18,7 +18,12 @@ import (
|
||||
// HypervisorType describes an hypervisor type.
|
||||
type HypervisorType string
|
||||
|
||||
type operation int
|
||||
|
||||
const (
|
||||
// FirecrackerHypervisor is the FC hypervisor.
|
||||
FirecrackerHypervisor HypervisorType = "firecracker"
|
||||
|
||||
// QemuHypervisor is the QEMU hypervisor.
|
||||
QemuHypervisor HypervisorType = "qemu"
|
||||
|
||||
@ -96,6 +101,9 @@ func (hType *HypervisorType) Set(value string) error {
|
||||
case "qemu":
|
||||
*hType = QemuHypervisor
|
||||
return nil
|
||||
case "firecracker":
|
||||
*hType = FirecrackerHypervisor
|
||||
return nil
|
||||
case "mock":
|
||||
*hType = MockHypervisor
|
||||
return nil
|
||||
@ -109,6 +117,8 @@ func (hType *HypervisorType) String() string {
|
||||
switch *hType {
|
||||
case QemuHypervisor:
|
||||
return string(QemuHypervisor)
|
||||
case FirecrackerHypervisor:
|
||||
return string(FirecrackerHypervisor)
|
||||
case MockHypervisor:
|
||||
return string(MockHypervisor)
|
||||
default:
|
||||
@ -121,6 +131,8 @@ func newHypervisor(hType HypervisorType) (hypervisor, error) {
|
||||
switch hType {
|
||||
case QemuHypervisor:
|
||||
return &qemu{}, nil
|
||||
case FirecrackerHypervisor:
|
||||
return &firecracker{}, nil
|
||||
case MockHypervisor:
|
||||
return &mockHypervisor{}, nil
|
||||
default:
|
||||
|
@ -96,8 +96,6 @@ var defaultKernelParameters = []Param{
|
||||
{"panic", "1"},
|
||||
}
|
||||
|
||||
type operation int
|
||||
|
||||
const (
|
||||
addDevice operation = iota
|
||||
removeDevice
|
||||
|
Loading…
Reference in New Issue
Block a user