glandium / vmfs-tools

http://glandium.org/projects/vmfs-tools/
GNU General Public License v2.0
76 stars 29 forks source link

vmfs-fuse on FreeBSD 10.0 #13

Open jovoro opened 10 years ago

jovoro commented 10 years ago

Hello,

i'm trying to mount some vmfs datastores via vmfs-fuse on a FreeBSD 10 box. Exactly the same datastores work fine under CentOS 6, but on FreeBSD I get this:

# vmfs-fuse  /dev/da29s1 /datastores/lhstor11
VMFS: Unable to read FS information
Unable to open filesystem

But when I use debugvmfs to list files, for example, it outputs the expected list of files:

# debugvmfs /dev/da29s1 ls
.
..
.fbb.sf
.fdc.sf
.pbc.sf
.sbc.sf
.vh.sf
.vSphere-HA
[...]
aims-bbp-001
FOM
geoc-ags3

The binaries compiled fine with clang, but I also tried with gcc, with the same result. Maybe someone can give me a push in the right direction?

Cheers, J.

jovoro commented 10 years ago

Apparently, in FreeBSD everything is a character device..?! Maybe someone can enlighten me why this should be right and if this would be an adequate solution. But for the moment, I fixed my issue with the following change:

diff --git a/vmfs-fuse/vmfs-fuse.c b/vmfs-fuse/vmfs-fuse.c
index 48e1537..5900c93 100644
--- a/vmfs-fuse/vmfs-fuse.c
+++ b/vmfs-fuse/vmfs-fuse.c
@@ -464,7 +464,7 @@ static int vmfs_fuse_opts_func(void *data, const char *arg, int key,
       }
       if (S_ISDIR(st.st_mode)) {
          opts->mountpoint = strdup(arg);
-      } else if (S_ISREG(st.st_mode) || S_ISBLK(st.st_mode)) {
+      } else if (S_ISREG(st.st_mode) || S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode)) {
          *(opts->path++) = strdup(arg);
       }
       return 0;

I can now mount datastores, further tests are pending.