diff --git a/virtcontainers/hypervisor.go b/virtcontainers/hypervisor.go index 8387674a78..0be3ea96d2 100644 --- a/virtcontainers/hypervisor.go +++ b/virtcontainers/hypervisor.go @@ -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: diff --git a/virtcontainers/qemu.go b/virtcontainers/qemu.go index 051db4cb29..1d152f653b 100644 --- a/virtcontainers/qemu.go +++ b/virtcontainers/qemu.go @@ -96,8 +96,6 @@ var defaultKernelParameters = []Param{ {"panic", "1"}, } -type operation int - const ( addDevice operation = iota removeDevice