mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-20 16:27:52 +00:00
gpu: Add config settings tests for hot-plug
Updated all references and config settings for hot-plug to match cold-plug Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
@@ -289,11 +289,19 @@ type HypervisorConfig struct {
|
||||
HotplugVFIOOnRootBus bool
|
||||
|
||||
// PCIeRootPort is used to indicate the number of PCIe Root Port devices
|
||||
// The PCIe Root Port device is used to hot-plug the PCIe device
|
||||
// The PCIe Root Port device is used to hot(cold)-plug the PCIe device
|
||||
PCIeRootPort uint32
|
||||
|
||||
// PCIeSwitchPort is used to indicate the number of PCIe Switch Ports
|
||||
// The PCIe Switch port is used to hot(cold)-plug the PCIe device
|
||||
PCIeSwitchPort uint32
|
||||
|
||||
// HotPlugVFIO is used to indicate if devices need to be hotplugged on the
|
||||
// root port, switch, bridge or no port
|
||||
HotPlugVFIO hv.PCIePort
|
||||
|
||||
// ColdPlugVFIO is used to indicate if devices need to be coldplugged on the
|
||||
// root port, switch or no port
|
||||
// root port, switch, bridge or no port
|
||||
ColdPlugVFIO hv.PCIePort
|
||||
|
||||
// BootToBeTemplate used to indicate if the VM is created to be a template VM
|
||||
|
@@ -516,14 +516,15 @@ type HypervisorConfig struct {
|
||||
// ColdPlugVFIO is used to indicate if devices need to be coldplugged on the
|
||||
// root port, switch or no port
|
||||
ColdPlugVFIO hv.PCIePort
|
||||
// PCIeSwitchPort is used to indicate the number of PCIe Switch devices
|
||||
// The PCIe Switch Port device is sued to hot-plug PCIe devices
|
||||
PCIeSwitchPort uint32
|
||||
|
||||
// PCIeRootPort is used to indicate the number of PCIe Root Port devices
|
||||
// The PCIe Root Port device is used to hot-plug the PCIe device
|
||||
PCIeRootPort uint32
|
||||
|
||||
// PCIeSwitchPort is used to indicate the number of PCIe Switch devices
|
||||
// The PCIe Switch Port device is sued to hot-plug PCIe devices
|
||||
PCIeSwitchPort uint32
|
||||
|
||||
// NumVCPUs specifies default number of vCPUs for the VM.
|
||||
NumVCPUs uint32
|
||||
|
||||
|
@@ -488,8 +488,10 @@ func loadSandboxConfig(id string) (*SandboxConfig, error) {
|
||||
DisableNestingChecks: hconf.DisableNestingChecks,
|
||||
DisableImageNvdimm: hconf.DisableImageNvdimm,
|
||||
HotplugVFIOOnRootBus: hconf.HotplugVFIOOnRootBus,
|
||||
HotPlugVFIO: hconf.HotPlugVFIO,
|
||||
ColdPlugVFIO: hconf.ColdPlugVFIO,
|
||||
PCIeRootPort: hconf.PCIeRootPort,
|
||||
PCIeSwitchPort: hconf.PCIeSwitchPort,
|
||||
BootToBeTemplate: hconf.BootToBeTemplate,
|
||||
BootFromTemplate: hconf.BootFromTemplate,
|
||||
DisableVhostNet: hconf.DisableVhostNet,
|
||||
|
@@ -203,8 +203,12 @@ type HypervisorConfig struct {
|
||||
// root bus instead of a bridge.
|
||||
HotplugVFIOOnRootBus bool
|
||||
|
||||
// HotPlugVFIO is used to indicate if devices need to be hotplugged on the
|
||||
// root, switch, bridge or no-port
|
||||
HotPlugVFIO hv.PCIePort
|
||||
|
||||
// ColdPlugVFIO is used to indicate if devices need to be coldplugged on the
|
||||
// root port or a switch or no-port
|
||||
// root, bridge, switch or no-port
|
||||
ColdPlugVFIO hv.PCIePort
|
||||
|
||||
// BootToBeTemplate used to indicate if the VM is created to be a template VM
|
||||
|
@@ -84,6 +84,7 @@ type QemuState struct {
|
||||
PCIeRootPort int
|
||||
PCIeSwitchPort int
|
||||
HotplugVFIOOnRootBus bool
|
||||
HotplugVFIO hv.PCIePort
|
||||
ColdPlugVFIO hv.PCIePort
|
||||
}
|
||||
|
||||
@@ -283,7 +284,7 @@ func (q *qemu) setup(ctx context.Context, id string, hypervisorConfig *Hyperviso
|
||||
|
||||
q.Logger().Debug("Creating UUID")
|
||||
q.state.UUID = uuid.Generate().String()
|
||||
|
||||
q.state.HotPlugVFIO = q.config.HotPlugVFIO
|
||||
q.state.ColdPlugVFIO = q.config.ColdPlugVFIO
|
||||
q.state.HotplugVFIOOnRootBus = q.config.HotplugVFIOOnRootBus
|
||||
q.state.PCIeRootPort = int(q.config.PCIeRootPort)
|
||||
|
Reference in New Issue
Block a user