mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-02-23 15:34:28 +01:00
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:
@@ -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{}
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ func MakeRuntimeConfigFileData(config RuntimeConfigOptions) string {
|
||||
enable_iothreads = ` + strconv.FormatBool(config.EnableIOThreads) + `
|
||||
hotplug_vfio_on_root_bus = ` + strconv.FormatBool(config.HotplugVFIOOnRootBus) + `
|
||||
pcie_root_port = ` + strconv.FormatUint(uint64(config.PCIeRootPort), 10) + `
|
||||
cold_plug_vfio = "` + config.ColdPlugVFIO + `"
|
||||
cold_plug_vfio = "` + config.ColdPlugVFIO.String() + `"
|
||||
msize_9p = ` + strconv.FormatUint(uint64(config.DefaultMsize9p), 10) + `
|
||||
enable_debug = ` + strconv.FormatBool(config.HypervisorDebug) + `
|
||||
guest_hook_path = "` + config.DefaultGuestHookPath + `"
|
||||
|
||||
Reference in New Issue
Block a user