Skip to content

Commit

Permalink
fix(climc): add VALID_CONTAINER_DEVICE_TYPES for isolated device pars…
Browse files Browse the repository at this point in the history
…er (#21057)
  • Loading branch information
zexi authored Aug 19, 2024
1 parent 61e0c4d commit 234a9f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cloudcommon/cmdline/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,12 @@ func ParseIsolatedDevice(desc string, idx int) (*compute.IsolatedDeviceConfig, e
}
dev := new(compute.IsolatedDeviceConfig)
parts := strings.Split(desc, ":")
devTypes := sets.NewString(compute.VALID_PASSTHROUGH_TYPES...)
devTypes.Insert(compute.VALID_CONTAINER_DEVICE_TYPES...)
for _, p := range parts {
if regutils.MatchUUIDExact(p) {
dev.Id = p
} else if utils.IsInStringArray(p, compute.VALID_PASSTHROUGH_TYPES) {
} else if devTypes.Has(p) {
dev.DevType = p
} else if strings.HasPrefix(p, "vendor=") {
dev.Vendor = p[len("vendor="):]
Expand Down

0 comments on commit 234a9f6

Please sign in to comment.