gpu: Check for VFIO port assignments

Bailing out early if the port is wrong, allowed port settings are
no-port, root-port, switch-port

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
Zvonko Kaiser
2023-05-02 08:12:18 +00:00
parent 138ada049c
commit 13d7f39c71
5 changed files with 45 additions and 5 deletions

View File

@@ -48,10 +48,12 @@ func (p PCIePort) String() string {
return "root-port"
case SwitchPort:
return "switch-port"
case BridgePort:
return "bridge-port"
case NoPort:
return "no-port"
}
return fmt.Sprintf("unknown PCIePort: %s", string(p))
return fmt.Sprintf("<unknown PCIePort: %s>", string(p))
}
type HypervisorState struct {