mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-07 00:14:21 +01:00
Each hypervisor is different and supports different options regarding the network interface it creates. In particular, the multiqueue option is not supported by Firecracker and should not be assumed by default. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
50 lines
942 B
Go
50 lines
942 B
Go
// Copyright (c) 2017 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package virtcontainers
|
|
|
|
const (
|
|
blockDeviceSupport = 1 << iota
|
|
blockDeviceHotplugSupport
|
|
multiQueueSupport
|
|
)
|
|
|
|
type capabilities struct {
|
|
flags uint
|
|
}
|
|
|
|
func (caps *capabilities) isBlockDeviceSupported() bool {
|
|
if caps.flags&blockDeviceSupport != 0 {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (caps *capabilities) setBlockDeviceSupport() {
|
|
caps.flags = caps.flags | blockDeviceSupport
|
|
}
|
|
|
|
func (caps *capabilities) isBlockDeviceHotplugSupported() bool {
|
|
if caps.flags&blockDeviceHotplugSupport != 0 {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (caps *capabilities) setBlockDeviceHotplugSupport() {
|
|
caps.flags |= blockDeviceHotplugSupport
|
|
}
|
|
|
|
func (caps *capabilities) isMultiQueueSupported() bool {
|
|
if caps.flags&multiQueueSupport != 0 {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (caps *capabilities) setMultiQueueSupport() {
|
|
caps.flags |= multiQueueSupport
|
|
}
|