summaryrefslogtreecommitdiff
path: root/tests/virfiledata
Commit message (Collapse)AuthorAgeFilesLines
* virfile: Add Quobyte as a shared fsSilvan Kaiser2019-07-191-0/+1
| | | | | | | | | This adds detection of a Quobyte as a shared file system for live migration. Signed-off-by: Silvan Kaiser <silvan@quobyte.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* virfile: added GPFS as shared fsDiego Michelotto2019-02-261-0/+1
| | | | | | | | | | | | | Added GPFS as shared file system recognized during live migration security checks. GPFS is 'IBM General Parallel File System' also called 'IBM Spectrum Scale' BUG: https://bugzilla.redhat.com/show_bug.cgi?id=1679528 Signed-off-by: Diego Michelotto <diego.michelotto@cnaf.infn.it> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
* virfile: Detect ceph as shared FSMichal Privoznik2019-01-281-0/+2
| | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1665553 Ceph can be mounted just like any other filesystem and in fact is a shared and cluster filesystem. The filesystem magic constant was taken from kernel sources as it is not in magic.h yet. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
* virfile: Rework virFileIsSharedFixFUSEMichal Privoznik2018-10-101-0/+2
| | | | | | | | | | | | | | | | | There are couple of things wrong with the current implementation. The first one is that in the first loop the code tries to build a list of fuse.glusterfs mount points. Well, since the strings are allocated in a temporary buffer and are not duplicated this results in wrong decision made later in the code. The second problem is that the code does not take into account subtree mounts. For instance, if there's a fuse.gluster mounted at /some/path and another FS mounted at /some/path/subdir the code would not recognize this subdir mount. Reported-by: Han Han <hhan@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
* virfiletst: Test virFileIsSharedFSMichal Privoznik2018-10-101-0/+33
| | | | | | | | | | | | | | | | | | | | | | | Introduce some basic test cases for virFileIsSharedFS(). More will be added later. In order to achieve desired result, mocks for setmntent() and statfs() need to be invented because the first thing that virFileIsSharedFS() does is calling the latter. If it finds a FUSE mount it'll call the former. The mock might look a bit complicated, but in fact it's quite simple. The test sets LIBVIRT_MTAB env variable to hold the absolute path to a file containing mount table. Then, statfs() returns matching FS it finds, and setmntent() is there just to replace /proc/mounts with the file the test wants to load. Adding this test also exposed a bug we have - because we assume the given path points to a file we cut off what we assume is a file name to obtain directory path and only then we call statfs(). This is buggy because the passed path could be already a mount point. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
* Fix bug in identifying sub-mountsDaniel P. Berrange2013-11-281-0/+33
| | | | | | | | | | | | | | The code for extracting sub-mounts would just do a STRPREFIX check on the mount. This was flawed because if there were the following mounts /etc/aliases /etc/aliases.db and '/etc/aliases' was asked for, it would return both even though the latter isn't a sub-mount. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Pull lxcContainerGetSubtree out into shared virfile moduleDaniel P. Berrange2013-11-281-0/+31
Move the code for lxcContainerGetSubtree into the virfile module creating 2 new functions int virFileGetMountSubtree(const char *mtabpath, const char *prefix, char ***mountsret, size_t *nmountsret); int virFileGetMountReverseSubtree(const char *mtabpath, const char *prefix, char ***mountsret, size_t *nmountsret); Add a new virfiletest.c test case to validate the new code. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>