libvirt/tests/vircgroupdata
Juan Hernandez dacd160d74 Avoid hidden cgroup mount points
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>
2017-07-13 09:37:52 +02:00
..
all-in-one.mounts tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
all-in-one.parsed tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
cgroups1.mounts tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
cgroups1.parsed tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
cgroups2.mounts tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
cgroups2.parsed tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
cgroups3.mounts tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
cgroups3.parsed tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
fedora-18.mounts tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
fedora-18.parsed tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
fedora-21.mounts tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
fedora-21.parsed tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
kubevirt.mounts Avoid hidden cgroup mount points 2017-07-13 09:37:52 +02:00
kubevirt.parsed Avoid hidden cgroup mount points 2017-07-13 09:37:52 +02:00
no-cgroups.mounts tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
no-cgroups.parsed tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
ovirt-node-6.6.mounts tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
ovirt-node-6.6.parsed tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
ovirt-node-7.1.mounts tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
ovirt-node-7.1.parsed tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
rhel-7.1.mounts tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00
rhel-7.1.parsed tests: Add tests for virCgroupDetectMounts 2015-03-18 09:53:24 +01:00