gpu: Add new struct PCIePort

For the hypervisor to distinguish between PCIe components, adding
a new enum that can be used for hot-plug and cold-plug of PCIe devices

Fixes: #6687

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
Zvonko Kaiser 2023-04-20 10:56:29 +00:00
parent 509bc8b6c8
commit c18ceae109

View File

@ -26,6 +26,20 @@ type CPUDevice struct {
ID string 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"
)
type HypervisorState struct { type HypervisorState struct {
BlockIndexMap map[int]struct{} BlockIndexMap map[int]struct{}
@ -45,6 +59,6 @@ type HypervisorState struct {
VirtiofsDaemonPid int VirtiofsDaemonPid int
Pid int Pid int
PCIeRootPort int PCIeRootPort int
ColdPlugVFIO PCIePort
HotplugVFIOOnRootBus bool HotplugVFIOOnRootBus bool
} }