Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
virtcontainers: Add firecracker as a supported hypervisor
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mcastelino committed Dec 20, 2018
1 parent c1d3f1a commit e65bafa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 12 additions & 0 deletions virtcontainers/hypervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ var defaultKernelParameters = []Param{
{"panic", "1"},
}

type operation int

const (
addDevice operation = iota
removeDevice
Expand Down

0 comments on commit e65bafa

Please sign in to comment.