@@ -152,14 +152,6 @@ func Validate(y *LimaYAML, warn bool) error {
152152 if err != nil {
153153 return fmt .Errorf ("field `mounts[%d].location` refers to an unexpandable path: %q: %w" , i , f .Location , err )
154154 }
155- switch loc {
156- case "/" , "/bin" , "/dev" , "/etc" , "/home" , "/opt" , "/sbin" , "/tmp" , "/usr" , "/var" :
157- return fmt .Errorf ("field `mounts[%d].location` must not be a system path such as /etc or /usr" , i )
158- // home directory defined in "cidata.iso:/user-data"
159- case * y .User .Home :
160- return fmt .Errorf ("field `mounts[%d].location` is the reserved internal home directory" , i )
161- }
162-
163155 st , err := os .Stat (loc )
164156 if err != nil {
165157 if ! errors .Is (err , os .ErrNotExist ) {
@@ -169,6 +161,14 @@ func Validate(y *LimaYAML, warn bool) error {
169161 return fmt .Errorf ("field `mounts[%d].location` refers to a non-directory path: %q: %w" , i , f .Location , err )
170162 }
171163
164+ switch * f .MountPoint {
165+ case "/" , "/bin" , "/dev" , "/etc" , "/home" , "/opt" , "/sbin" , "/tmp" , "/usr" , "/var" :
166+ return fmt .Errorf ("field `mounts[%d].mountPoint` must not be a system path such as /etc or /usr" , i )
167+ // home directory defined in "cidata.iso:/user-data"
168+ case * y .User .Home :
169+ return fmt .Errorf ("field `mounts[%d].mountPoint` is the reserved internal home directory %q" , i , * y .User .Home )
170+ }
171+
172172 if _ , err := units .RAMInBytes (* f .NineP .Msize ); err != nil {
173173 return fmt .Errorf ("field `msize` has an invalid value: %w" , err )
174174 }
0 commit comments