mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-25 15:02:45 +00:00
gpu: Add Rawdevices to hypervisor
RawDevics are used to get PCIe device info early before the sandbox is started to make better PCIe topology decisions Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
parent
6107c32d70
commit
e2b5e7f73b
@ -509,6 +509,10 @@ type HypervisorConfig struct {
|
||||
// The PCIe Root Port device is used to hot-plug the PCIe device
|
||||
PCIeRootPort uint32
|
||||
|
||||
// RawDevics are used to get PCIe device info early before the sandbox
|
||||
// is started to make better PCIe topology decisions
|
||||
RawDevices []config.DeviceInfo
|
||||
|
||||
// ColdPlugVFIO is used to indicate if devices need to be coldplugged on the
|
||||
// root port, switch or no port
|
||||
ColdPlugVFIO hv.PCIePort
|
||||
|
@ -619,6 +619,12 @@ func newSandbox(ctx context.Context, sandboxConfig SandboxConfig, factory Factor
|
||||
if err := validateHypervisorConfig(&sandboxConfig.HypervisorConfig); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Aggregate all the container devices and update the HV config
|
||||
var devices []config.DeviceInfo
|
||||
for _, ct := range sandboxConfig.Containers {
|
||||
devices = append(devices, ct.DeviceInfos...)
|
||||
}
|
||||
sandboxConfig.HypervisorConfig.RawDevices = devices
|
||||
|
||||
// store doesn't require hypervisor to be stored immediately
|
||||
if err = s.hypervisor.CreateVM(ctx, s.id, s.network, &sandboxConfig.HypervisorConfig); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user