diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 945359931defd92ac54385b5d42c8d255d1b555b..1b4d4cf85e2ce69f27c3798765db4136c2d16c8b 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -1241,6 +1241,12 @@ cleanup: # ifndef AFS_FS_MAGIC # define AFS_FS_MAGIC 0x6B414653 # endif +# ifndef SMB_SUPER_MAGIC +# define SMB_SUPER_MAGIC 0x517B +# endif +# ifndef CIFS_SUPER_MAGIC +# define CIFS_SUPER_MAGIC 0xFF534D42 +# endif int virStorageFileIsSharedFSType(const char *path, @@ -1304,6 +1310,12 @@ int virStorageFileIsSharedFSType(const char *path, if ((fstypes & VIR_STORAGE_FILE_SHFS_AFS) && (sb.f_type == AFS_FS_MAGIC)) return 1; + if ((fstypes & VIR_STORAGE_FILE_SHFS_SMB) && + (sb.f_type == SMB_SUPER_MAGIC)) + return 1; + if ((fstypes & VIR_STORAGE_FILE_SHFS_CIFS) && + (sb.f_type == CIFS_SUPER_MAGIC)) + return 1; return 0; } @@ -1322,7 +1334,9 @@ int virStorageFileIsSharedFS(const char *path) VIR_STORAGE_FILE_SHFS_NFS | VIR_STORAGE_FILE_SHFS_GFS2 | VIR_STORAGE_FILE_SHFS_OCFS | - VIR_STORAGE_FILE_SHFS_AFS); + VIR_STORAGE_FILE_SHFS_AFS | + VIR_STORAGE_FILE_SHFS_SMB | + VIR_STORAGE_FILE_SHFS_CIFS); } int virStorageFileIsClusterFS(const char *path) diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 1f89839b09799fde6537c18a0512fb9c6f2c60ce..d5effa41c97166c43c0dd77585b8acff49c87c04 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -112,6 +112,8 @@ enum { VIR_STORAGE_FILE_SHFS_GFS2 = (1 << 1), VIR_STORAGE_FILE_SHFS_OCFS = (1 << 2), VIR_STORAGE_FILE_SHFS_AFS = (1 << 3), + VIR_STORAGE_FILE_SHFS_SMB = (1 << 4), + VIR_STORAGE_FILE_SHFS_CIFS = (1 << 5), }; int virStorageFileIsSharedFS(const char *path);