mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-25 02:40:04 +00:00
gpu: Add configuration option for cold-plug VFIO
Users can set cold-plug="root-port" to cold plug a VFIO device in QEMU Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
@@ -509,6 +509,10 @@ type HypervisorConfig struct {
|
||||
// The PCIe Root Port device is used to hot-plug the PCIe device
|
||||
PCIeRootPort uint32
|
||||
|
||||
// ColdPlugVFIO is used to indicate if devices need to be coldplugged on the
|
||||
// root port, switch or no port
|
||||
ColdPlugVFIO hv.PCIePort
|
||||
|
||||
// NumVCPUs specifies default number of vCPUs for the VM.
|
||||
NumVCPUs uint32
|
||||
|
||||
|
@@ -1177,7 +1177,8 @@ func (k *kataAgent) appendDevices(deviceList []*grpc.Device, c *Container) []*gr
|
||||
case config.VhostUserBlk:
|
||||
kataDevice = k.appendVhostUserBlkDevice(dev, device, c)
|
||||
case config.DeviceVFIO:
|
||||
kataDevice = k.appendVfioDevice(dev, device, c)
|
||||
k.Logger().Infof("### ColdPlugging container is not adding any VFIO devices")
|
||||
//kataDevice = k.appendVfioDevice(dev, device, c)
|
||||
}
|
||||
|
||||
if kataDevice == nil {
|
||||
|
@@ -487,6 +487,7 @@ func loadSandboxConfig(id string) (*SandboxConfig, error) {
|
||||
DisableNestingChecks: hconf.DisableNestingChecks,
|
||||
DisableImageNvdimm: hconf.DisableImageNvdimm,
|
||||
HotplugVFIOOnRootBus: hconf.HotplugVFIOOnRootBus,
|
||||
ColdPlugVFIO: hconf.ColdPlugVFIO,
|
||||
PCIeRootPort: hconf.PCIeRootPort,
|
||||
BootToBeTemplate: hconf.BootToBeTemplate,
|
||||
BootFromTemplate: hconf.BootFromTemplate,
|
||||
|
@@ -7,6 +7,7 @@
|
||||
package persistapi
|
||||
|
||||
import (
|
||||
hv "github.com/kata-containers/kata-containers/src/runtime/pkg/hypervisors"
|
||||
"github.com/opencontainers/runc/libcontainer/configs"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
)
|
||||
@@ -198,6 +199,10 @@ type HypervisorConfig struct {
|
||||
// root bus instead of a bridge.
|
||||
HotplugVFIOOnRootBus bool
|
||||
|
||||
// ColdPlugVFIO is used to indicate if devices need to be coldlugged on the
|
||||
// root port or a switch or no-port
|
||||
ColdPlugVFIO hv.PCIePort
|
||||
|
||||
// BootToBeTemplate used to indicate if the VM is created to be a template VM
|
||||
BootToBeTemplate bool
|
||||
|
||||
|
Reference in New Issue
Block a user