gpu: Add cold-plug test

Cold plug setting is now correctly decoded in toml

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
Zvonko Kaiser
2023-04-27 09:20:30 +00:00
parent dded731db3
commit 0fec2e6986
5 changed files with 29 additions and 10 deletions

View File

@@ -5,6 +5,8 @@
package hypervisors
import "fmt"
// Bridge is a bridge where devices can be hot plugged
type Bridge struct {
// DeviceAddr contains information about devices plugged and its address in the bridge
@@ -40,6 +42,18 @@ const (
NoPort = "no-port"
)
func (p PCIePort) String() string {
switch p {
case RootPort:
return "root-port"
case SwitchPort:
return "switch-port"
case NoPort:
return "no-port"
}
return fmt.Sprintf("unknown PCIePort: %s", string(p))
}
type HypervisorState struct {
BlockIndexMap map[int]struct{}