Skip to content

Commit

Permalink
controller: template: allow USB HostDevices
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Toso <[email protected]>
  • Loading branch information
victortoso committed Aug 11, 2023
1 parent 1d0a001 commit 602f34b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/virt-controller/services/renderresources.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,9 @@ func validatePermittedHostDevices(spec *v1.VirtualMachineInstanceSpec, config *v
for _, dev := range hostDevs.MediatedDevices {
supportedHostDevicesMap[dev.ResourceName] = true
}
for _, dev := range hostDevs.USB {
supportedHostDevicesMap[dev.ResourceName] = true
}
for _, hostDev := range spec.Domain.Devices.GPUs {
if _, exist := supportedHostDevicesMap[hostDev.DeviceName]; !exist {
errors = append(errors, fmt.Sprintf("GPU %s is not permitted in permittedHostDevices configuration", hostDev.DeviceName))
Expand Down

0 comments on commit 602f34b

Please sign in to comment.