virstoragefile: move virStorageFileIsClusterFS into virfile

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Pavel Hrdina 2020-12-07 12:04:41 +01:00
parent ec594462c1
commit abab80e29a
6 changed files with 16 additions and 14 deletions

View File

@ -2087,6 +2087,7 @@ virFileGetXAttr;
virFileGetXAttrQuiet; virFileGetXAttrQuiet;
virFileInData; virFileInData;
virFileIsCDROM; virFileIsCDROM;
virFileIsClusterFS;
virFileIsDir; virFileIsDir;
virFileIsExecutable; virFileIsExecutable;
virFileIsLink; virFileIsLink;
@ -3145,7 +3146,6 @@ virStorageFileGetSCSIKey;
virStorageFileGetUniqueIdentifier; virStorageFileGetUniqueIdentifier;
virStorageFileInit; virStorageFileInit;
virStorageFileInitAs; virStorageFileInitAs;
virStorageFileIsClusterFS;
virStorageFileParseBackingStoreStr; virStorageFileParseBackingStoreStr;
virStorageFileParseChainIndex; virStorageFileParseChainIndex;
virStorageFileProbeFormat; virStorageFileProbeFormat;

View File

@ -1466,7 +1466,7 @@ qemuMigrationSrcIsSafe(virDomainDefPtr def,
} else if (rc == 0) { } else if (rc == 0) {
unsafe = true; unsafe = true;
} }
if ((rc = virStorageFileIsClusterFS(src)) < 0) if ((rc = virFileIsClusterFS(src)) < 0)
return false; return false;
else if (rc == 1) else if (rc == 1)
continue; continue;

View File

@ -3709,6 +3709,19 @@ int virFileIsSharedFS(const char *path)
} }
int
virFileIsClusterFS(const char *path)
{
/* These are coherent cluster filesystems known to be safe for
* migration with cache != none
*/
return virFileIsSharedFSType(path,
VIR_FILE_SHFS_GFS2 |
VIR_FILE_SHFS_OCFS |
VIR_FILE_SHFS_CEPH);
}
#if defined(__linux__) && defined(WITH_SYS_MOUNT_H) #if defined(__linux__) && defined(WITH_SYS_MOUNT_H)
int int
virFileSetupDev(const char *path, virFileSetupDev(const char *path,

View File

@ -223,6 +223,7 @@ enum {
int virFileIsSharedFSType(const char *path, int fstypes) ATTRIBUTE_NONNULL(1); int virFileIsSharedFSType(const char *path, int fstypes) ATTRIBUTE_NONNULL(1);
int virFileIsSharedFS(const char *path) ATTRIBUTE_NONNULL(1); int virFileIsSharedFS(const char *path) ATTRIBUTE_NONNULL(1);
int virFileIsClusterFS(const char *path) ATTRIBUTE_NONNULL(1);
int virFileIsMountPoint(const char *file) ATTRIBUTE_NONNULL(1); int virFileIsMountPoint(const char *file) ATTRIBUTE_NONNULL(1);
int virFileIsCDROM(const char *path) int virFileIsCDROM(const char *path)
ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT;

View File

@ -1193,17 +1193,6 @@ virStorageFileGetMetadataFromFD(const char *path,
} }
int virStorageFileIsClusterFS(const char *path)
{
/* These are coherent cluster filesystems known to be safe for
* migration with cache != none
*/
return virFileIsSharedFSType(path,
VIR_FILE_SHFS_GFS2 |
VIR_FILE_SHFS_OCFS |
VIR_FILE_SHFS_CEPH);
}
#ifdef WITH_UDEV #ifdef WITH_UDEV
/* virStorageFileGetSCSIKey /* virStorageFileGetSCSIKey
* @path: Path to the SCSI device * @path: Path to the SCSI device

View File

@ -420,7 +420,6 @@ virStorageSourcePtr virStorageFileChainLookup(virStorageSourcePtr chain,
virStorageSourcePtr *parent) virStorageSourcePtr *parent)
ATTRIBUTE_NONNULL(1); ATTRIBUTE_NONNULL(1);
int virStorageFileIsClusterFS(const char *path);
bool virStorageIsFile(const char *path); bool virStorageIsFile(const char *path);
bool virStorageIsRelative(const char *backing); bool virStorageIsRelative(const char *backing);