mirror of
https://github.com/containers/podman.git
synced 2025-07-01 16:17:06 +08:00
machine: Re-enable USBs check for wsl machine set
Re-enable USBs check in wsl `SetProviderAttrs` function to prevent the user trying to set USB settings which isn't supported. Additionally removes a TODO in wsl's `CreateVM` function to check if the `opts.USBs` length is greater than 0. This check is done in a more generic way higher up the stack. Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
This commit is contained in:
@ -34,12 +34,6 @@ func (w WSLStubber) CreateVM(opts define.CreateVMOpts, mc *vmconfigs.MachineConf
|
||||
defer callbackFuncs.CleanIfErr(&err)
|
||||
go callbackFuncs.CleanOnSignal()
|
||||
mc.WSLHypervisor = new(vmconfigs.WSLConfig)
|
||||
// TODO
|
||||
// USB opts are unsupported in WSL. Need to account for that here
|
||||
// or up the stack
|
||||
// if len(opts.USBs) > 0 {
|
||||
// return nil, fmt.Errorf("USB host passthrough is not supported for WSL machines")
|
||||
// }
|
||||
|
||||
if cont, err := checkAndInstallWSL(opts.ReExec); !cont {
|
||||
appendOutputIfError(opts.ReExec, err)
|
||||
@ -159,10 +153,9 @@ func (w WSLStubber) SetProviderAttrs(mc *vmconfigs.MachineConfig, opts define.Se
|
||||
return errors.New("changing memory not supported for WSL machines")
|
||||
}
|
||||
|
||||
// TODO USB still needs to be plumbed for all providers
|
||||
// if USBs != nil {
|
||||
// setErrors = append(setErrors, errors.New("changing USBs not supported for WSL machines"))
|
||||
// }
|
||||
if opts.USBs != nil {
|
||||
return errors.New("changing USBs not supported for WSL machines")
|
||||
}
|
||||
|
||||
if opts.DiskSize != nil {
|
||||
return errors.New("changing disk size not supported for WSL machines")
|
||||
|
Reference in New Issue
Block a user