Skip to content

Commit f9f2909

Browse files
authored
Merge pull request #820 from keyingliu/MPC_Fix
Fix MountPointChecker
2 parents 4055dab + 2233a88 commit f9f2909

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

images/image_skel/prepare-node.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mkdir -p /host-var-lib/virtlet/images /hostlog/virtlet/vms /host-var-lib/virtlet
3434

3535
# set up KVM
3636
if [[ ! ${VIRTLET_DISABLE_KVM:-} ]]; then
37-
if ! kvm-ok >&/dev/null; then
37+
if ! kvm-ok &>/dev/null; then
3838
# try to fix the environment by loading appropriate modules
3939
modprobe kvm || (echo "Missing kvm module on the host" >&2 && exit 1)
4040
if grep vmx /proc/cpuinfo &>/dev/null; then

pkg/utils/mountinfo.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,19 @@ LineReader:
6565
case io.EOF:
6666
break LineReader
6767
case nil:
68+
// strip eol
69+
line = strings.Trim(line, "\n")
70+
71+
// split and parse entries acording to section 3.5 in
72+
// https://www.kernel.org/doc/Documentation/filesystems/proc.txt
73+
// TODO: whitespaces and control chars in names are encoded as
74+
// octal values (e.g. for "x x": "x\040x") what should be expanded
75+
// in both mount point source and target
76+
parts := strings.Split(line, " ")
77+
mi[parts[4]] = mountEntry{Source: parts[9], Fs: parts[8]}
78+
default:
6879
return mountPointChecker{}, err
6980
}
70-
71-
// strip eol
72-
line = strings.Trim(line, "\n")
73-
74-
// split and parse entries acording to section 3.5 in
75-
// https://www.kernel.org/doc/Documentation/filesystems/proc.txt
76-
// TODO: whitespaces and control chars in names are encoded as
77-
// octal values (e.g. for "x x": "x\040x") what should be expanded
78-
// in both mount point source and target
79-
parts := strings.Split(line, " ")
80-
mi[parts[4]] = mountEntry{Source: parts[9], Fs: parts[8]}
8181
}
8282
return mountPointChecker{mountInfo: mi}, nil
8383
}
@@ -107,7 +107,7 @@ func (mpc mountPointChecker) IsPathAnNs(path string) bool {
107107
if !isMountPoint {
108108
return false
109109
}
110-
return entry.Fs == "nsfs"
110+
return entry.Fs == "nsfs" || entry.Fs == "proc"
111111
}
112112

113113
type fakeMountPointChecker struct{}

0 commit comments

Comments
 (0)