[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] util: recognize SMB filesystems as shared



On 09/26/2013 03:43 AM, Laine Stump wrote:
> This should resolve:
> 
>   https://bugzilla.redhat.com/show_bug.cgi?id=1012085
> 
> libvirt previously recognized NFS, GFS2, OCFS2, and AFS filesystems as
> "shared", and thus eligible for exceptions to certain rules/actions
> about chowning image files before handing them off to a guest. This
> patch widens the definition of "shared filesystem" to include the SMB
> filesystem (sometimes called CIFS, or "Windows file sharing").
> ---
>  src/util/virstoragefile.c | 9 ++++++++-
>  src/util/virstoragefile.h | 1 +
>  2 files changed, 9 insertions(+), 1 deletion(-)

Coreutils includes a rather extensive list of file systems (alas, it's
GPLv3+ code, so we can't use it verbatim without asking Jim Meyering and
other coreutils folks to relax the license):
http://git.sv.gnu.org/cgit/coreutils.git/tree/src/stat.c#n243

> 
> diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
> index 0b9cec3..ed43b2b 100644
> --- a/src/util/virstoragefile.c
> +++ b/src/util/virstoragefile.c
> @@ -1241,6 +1241,9 @@ cleanup:
>  # ifndef AFS_FS_MAGIC
>  #  define AFS_FS_MAGIC 0x6B414653
>  # endif
> +# ifndef SMB_SUPER_MAGIC
> +#  define SMB_SUPER_MAGIC 0x517B
> +# endif

This is correct; but since samba and cifs are highly inter-related (same
protocol, just which driver is implementing it), you also need a define
for CIFS_SUPER_MAGIC 0xff534d42.

Looking forward to v2.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]