mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-21 00:04:19 +01:00
gpu: Moved the PCIe configs to drivers
The hypervisor_state file was the wrong location for the PCIe Port settings, moved everything under device umbrella, where it can be consumed more easily and we do not get into circular deps. Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
package hypervisors
|
||||
|
||||
import "fmt"
|
||||
import "github.com/kata-containers/kata-containers/src/runtime/pkg/device/config"
|
||||
|
||||
// Bridge is a bridge where devices can be hot plugged
|
||||
type Bridge struct {
|
||||
@@ -28,34 +28,6 @@ type CPUDevice struct {
|
||||
ID string
|
||||
}
|
||||
|
||||
// PCIePort distinguish only between root and switch port
|
||||
type PCIePort string
|
||||
|
||||
const (
|
||||
// RootPort attach VFIO devices to a root-port
|
||||
RootPort PCIePort = "root-port"
|
||||
// SwitchPort attach VFIO devices to a switch-port
|
||||
SwitchPort = "switch-port"
|
||||
// BridgePort is the default
|
||||
BridgePort = "bridge-port"
|
||||
// NoPort is for disabling VFIO hotplug/coldplug
|
||||
NoPort = "no-port"
|
||||
)
|
||||
|
||||
func (p PCIePort) String() string {
|
||||
switch p {
|
||||
case RootPort:
|
||||
fallthrough
|
||||
case SwitchPort:
|
||||
fallthrough
|
||||
case BridgePort:
|
||||
fallthrough
|
||||
case NoPort:
|
||||
return string(p)
|
||||
}
|
||||
return fmt.Sprintf("<unknown PCIePort: %s>", string(p))
|
||||
}
|
||||
|
||||
type HypervisorState struct {
|
||||
BlockIndexMap map[int]struct{}
|
||||
// Type of hypervisor, E.g. qemu/firecracker/acrn.
|
||||
@@ -76,7 +48,7 @@ type HypervisorState struct {
|
||||
Pid int
|
||||
PCIeRootPort int
|
||||
PCIeSwitchPort int
|
||||
HotPlugVFIO PCIePort
|
||||
ColdPlugVFIO PCIePort
|
||||
HotPlugVFIO config.PCIePort
|
||||
ColdPlugVFIO config.PCIePort
|
||||
HotplugVFIOOnRootBus bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user