Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions virtcontainers/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ package virtcontainers
const (
blockDeviceSupport = 1 << iota
blockDeviceHotplugSupport
hotplugUnsupported
plan9FSUnsupported
)

type capabilities struct {
Expand Down Expand Up @@ -35,3 +37,25 @@ func (caps *capabilities) isBlockDeviceHotplugSupported() bool {
func (caps *capabilities) setBlockDeviceHotplugSupport() {
caps.flags |= blockDeviceHotplugSupport
}

func (caps *capabilities) isHotplugSupported() bool {
if caps.flags&hotplugUnsupported == 0 {
return true
}
return false
}

func (caps *capabilities) setHotplugUnsupported() {
caps.flags |= hotplugUnsupported
}

func (caps *capabilities) is9pSupported() bool {
if caps.flags&plan9FSUnsupported == 0 {
return true
}
return false
}

func (caps *capabilities) set9pUnsupported() {
caps.flags |= plan9FSUnsupported
}
2 changes: 2 additions & 0 deletions virtcontainers/hypervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
// HypervisorType describes an hypervisor type.
type HypervisorType string

type operation int

const (
// QemuHypervisor is the QEMU hypervisor.
QemuHypervisor HypervisorType = "qemu"
Expand Down
2 changes: 0 additions & 2 deletions virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ var defaultKernelParameters = []Param{
{"panic", "1"},
}

type operation int

const (
addDevice operation = iota
removeDevice
Expand Down