qemuDomainGetPreservedMounts fails with duplicate /dev mounts
It is possible to have duplicates of the same mount in /proc/mounts
under Linux. The function qemuDomainGetPreservedMounts
in qemu_domain.c
fails in the case where /dev
is a duplicate entry (I recently encountered this in a real system, see: https://github.com/warewulf/warewulf3/issues/242). I have not tested what happens if /dev/*
mounts are duplicated, but that may produce strange results as well. Specifically, if /dev
is duplicated in the mount table, qemuDomainGetPreservedMounts
will fail to identify any subtree mounts, and important subtree mounts like /dev/pts
will not happen.
While this is definitely an edge-case, it seems like it should be relatively easy to fix. For instance, virFileGetMountSubtreeImpl
already finishes by sorting the list. It could also eliminate non-unique entries.
Happy to put together an MR if wanted.