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

Commit

Permalink
virtcontainers: hypervisor: Add capability regarding multiqueue support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastien Boeuf committed Dec 14, 2018
1 parent 0bcd221 commit a227ab8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions virtcontainers/capabilities.go
Expand Up @@ -8,6 +8,7 @@ package virtcontainers
const (
blockDeviceSupport = 1 << iota
blockDeviceHotplugSupport
multiQueueSupport
)

type capabilities struct {
Expand Down Expand Up @@ -35,3 +36,14 @@ func (caps *capabilities) isBlockDeviceHotplugSupported() bool {
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
}
2 changes: 2 additions & 0 deletions virtcontainers/qemu_amd64.go
Expand Up @@ -108,6 +108,8 @@ func (q *qemuAmd64) capabilities() capabilities {
caps.setBlockDeviceHotplugSupport()
}

caps.setMultiQueueSupport()

return caps
}

Expand Down
1 change: 1 addition & 0 deletions virtcontainers/qemu_arch_base.go
Expand Up @@ -237,6 +237,7 @@ func (q *qemuArchBase) kernelParameters(debug bool) []Param {
func (q *qemuArchBase) capabilities() capabilities {
var caps capabilities
caps.setBlockDeviceHotplugSupport()
caps.setMultiQueueSupport()
return caps
}

Expand Down
2 changes: 2 additions & 0 deletions virtcontainers/qemu_ppc64le.go
Expand Up @@ -94,6 +94,8 @@ func (q *qemuPPC64le) capabilities() capabilities {
caps.setBlockDeviceHotplugSupport()
}

caps.setMultiQueueSupport()

return caps
}

Expand Down

0 comments on commit a227ab8

Please sign in to comment.