Clean NewVM func

This commit is contained in:
AlexSSD7 2023-09-02 11:10:14 +01:00
commit cd5b6dc48d
6 changed files with 360 additions and 184 deletions

View file

@ -29,6 +29,8 @@ func TerminateProcess(pid int) error {
// that there are no double-mounts.
func CheckDeviceSeemsMounted(devPathPrefix string) (bool, error) {
// Quite a bit hacky implementation, but it's to be used as a failsafe band-aid anyway.
devPathPrefix = filepath.Clean(devPathPrefix)
absDevPathPrefix, err := filepath.Abs(devPathPrefix)
if err != nil {
return false, errors.Wrap(err, "get abs path")