mirror of https://gitee.com/openkylin/libvirt.git
dacd160d74
Currently the scan of the /proc/mounts file used to find cgroup mount points doesn't take into account that mount points may hidden by other mount points. For, example in certain Kubernetes environments the /proc/mounts contains the following lines: cgroup /sys/fs/cgroup/net_prio,net_cls cgroup ... tmpfs /sys/fs/cgroup tmpfs ... cgroup /sys/fs/cgroup/net_cls,net_prio cgroup ... In this particular environment the first mount point is hidden by the second one. The correct mount point is the third one, but libvirt will never process it because it only checks the first mount point for each controller (net_cls in this case). So libvirt will try to use the first mount point, which doesn't actually exist, and the complete detection process will fail. To avoid that issue this patch changes the virCgroupDetectMountsFromFile function so that when there are duplicates it takes the information from the last line in /proc/mounts. This requires removing the previous explicit condition to skip duplicates, and adding code to free the memory used by the processing of duplicated lines. Related-To: https://bugzilla.redhat.com/1468214 Related-To: https://github.com/kubevirt/libvirt/issues/4 Signed-off-by: Juan Hernandez <jhernand@redhat.com> |
||
---|---|---|
.. | ||
all-in-one.mounts | ||
all-in-one.parsed | ||
cgroups1.mounts | ||
cgroups1.parsed | ||
cgroups2.mounts | ||
cgroups2.parsed | ||
cgroups3.mounts | ||
cgroups3.parsed | ||
fedora-18.mounts | ||
fedora-18.parsed | ||
fedora-21.mounts | ||
fedora-21.parsed | ||
kubevirt.mounts | ||
kubevirt.parsed | ||
no-cgroups.mounts | ||
no-cgroups.parsed | ||
ovirt-node-6.6.mounts | ||
ovirt-node-6.6.parsed | ||
ovirt-node-7.1.mounts | ||
ovirt-node-7.1.parsed | ||
rhel-7.1.mounts | ||
rhel-7.1.parsed |